3 ms·
In my experience writing C++ as a hobbyist & minor professional work, it leads to complexity for a couple reasons. - Lack of higher order functions generates b
by pnathan 15y ago
In my experience writing C++ as a hobbyist & minor professional work, it leads to complexity for a couple reasons.
- Lack of higher order functions generates boilerplate classes for fairly simplistic closure-istic operations
- Using templates with any sophistication infects gobblygooky templating syntax around your codebase. Since templates are actually a really nifty concept and worth using, this happens pretty quickly and now your codebase has more angle brackets than braces. ;)
- Inability to add syntactic abstraction means everything is written out, all the time.
I spent a lot of time learning C++98. After I got exposed to other languages, I don't think I'm going back to C++ without a good reason. There's too much ceremony for too little gain. Arguably with sufficient blood, sweat, and tears libraries can be written to make C++ do or fake what other languages do easily, e.g., regex, closures or continuations.
I think that taking the dynamic language approach of C in the performance parts and dynamic language for the rest is a better way to architect your system. Or, select a dynamic language that compiles to native code. :-)
- Leynos 15y ago"Lack of higher order functions generates boilerplate classes for fairly simplistic closure-istic operations" Do you think this will change now that C++ has closures?
- pnathan 15y agoIMO, it depends on how 'progressive' the team is and how open they are to using the features.
- fauigerzigerk 15y agoInability to add syntactic abstraction means everything is written out, all the time. I disagree with that one. Of all popular languages, only Python and Ruby (maybe C#) come anywhere close to the level of syntactic abstraction that C++ supports.
- pnathan 15y agoWhen I say syntactic abstraction, I mean Lisp-style macros. Python's decorators do a weaker version of the same thing.