3 ms·
Oh, well the dot syntax is just, well, syntactic sugar, and arguing that THAT is the reason anyone (who knows what they are doing) uses C++ is silly. It's becau
by duaneb 14y ago
Oh, well the dot syntax is just, well, syntactic sugar, and arguing that THAT is the reason anyone (who knows what they are doing) uses C++ is silly. It's because of inheritance and DRY so you write less code.
- rayiner 14y agoRight, and my point is that I've never seen a situation where inheritance really makes things dramatically clearer versus the alternatives (indeed, the mantra in C++ these days is that you should have "has-a" relationships with composition versus "is-a" relationships with inheritance). I think inheritance/OOP encourages you to draw module boundaries in the wrong place. It encourages you to spread the logic of an object over several modules of code. If you find yourself using inheritance, you'd better ask yourself: could I instead abstract my base class into a self-contained object that my new object could hold a reference to? See: http://www.paulgraham.com/noop.html http://www.paulgraham.com/noop.html