Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The term "C with classes" is almost used as an insult in some circles. I wonder if "C++ without classes" would be a better idea.


C++ without polymorphism or inheritance is how the people that I think are worth listening to seem to do things.


How would that be a good idea? I don't understand how I could write effective software without polymorphism or inheritance, other than in tiny tiny applications.


I've written entire components for networked and multiplayer modes for games, and an algorithmic trading system that uses ML in C++ using just structs, unions, templates, functions and composition (no polymorphism or inheritance).


Inheritance is syntactic sugar for composition. But, I think of it as reverse-SS, because I find composition much more readable.


Think about this: what does it give you besides generic execution and data when the size of the data varies?

Templates already let you build generic data structures and algorithms when the size of the data on doesn't vary.


without runtime polymorphism.

/pedantic++




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: