Home
angry

Сентябрь 2009

Вс Пн Вт Ср Чт Пт Сб
  12345
6789101112
13141516171819
20212223242526
27282930   

Реклама

На этой странице

Трансляция

RSS Atom
Разработано LiveJournal.com

25 Ноя, 2008

Ктулху

C++ FQA

[21.6] Is a Circle a kind-of an Ellipse?
FAQ: Sometimes it is, most frequently it isn't.

Q: But I have a Ph.D. in Mathematics, and I'm sure a Circle is a kind of an Ellipse! Does this mean Marshall Cline is stupid? Or that C++ is stupid? Or that OO is stupid?

FAQ: It means a different thing: your intuition is wrong in the sense that it leads you to make wrong decisions about inheritance. The right way to think about "kind-of" is this: B is a kind of A if you can always substitute a B for an A.

FQA: Instead of admitting that OO is not a natural language, and it doesn't have to map directly to a natural language, the FAQ actively tries to persuade you to change the way you use natural language words to make your thinking OO-compatible. Next, they'll ship patches you should apply to your DNA, and a sticker saying "Designed for C++ Programming" for your skull.

http://yosefk.com/c++fqa/inheritance-proper.html


Читаю уже неделю потихоньку, ржу в голос.
Метки: ,