logoalt Hacker News

glouwbuglast Wednesday at 4:27 PM1 replyview on HN

The fun thing about C++ is that it’s really hard. The even more fun thing is that the domain knowledge behind is even harder - game engines, high performance clusters, emulators, real time simulations, rendering engines, high frequency trading - so more often than not most C++ devs commit to learning a language subset and then focus their energy on the task at hand. A PS3 emulator might be a switch statement (not really, but you get the point)


Replies

locknitpickertoday at 4:33 AM

> The fun thing about C++ is that it’s really hard.

C++ definitely has a higher cognitive load than your average interpreted language. However, a big part of that cognitive load is due to support for highly optimized scenarios such as return value optimization. Most people write code that doesn't require it at all, and that's perfectly fine. The same goes for move semantics. You can spend a whole career writing code where all your classes do deep copies when passing objects by value. The compiler even graciously helps you not have to write all constructors and assignment operators to have your POCO class work out of the box. But once you feel the need to avoid those copies then you need to know what to do to nudge the compiler do that for you. That is a while subtle dance. That's when the cognitive load starts growing.