Can a penguin be inherited from a bird?

Poll on the Cross Join telegram channel "Is it possible to inherit the Penguin class from the Bird class?" surprised. Most of the people answered quite definitely "yes" or "no" (the survey results are attached at the end of the article). I did not expect such a situation, so I decided to write a short note.







In fact, if you are asked this question in an interview, know that there is a catch. Even two.







image







"", , : "", "()", .







, , .







, , , , .. , .







- -.







— , . - . , , — .







, "" .







, . bounded context .







: , , , — , id . . - — .







: "" , , . , : , , .. .







In general, seriously speaking, in real programming there will be no such problems as a penguin bird, if you do not engage in spherical overengineering with thinking over non-existent things in advance ( here is a good article about that). So this is more of an interview case to be better aware of.







Upd. They asked to attach the survey results to the article itself:










All Articles