Comment

Comment by jb1991

> the added features can not remove complexity, they can just add to it

There are countless examples of the so-called modern C++ features reducing complexity in code.

For example, it is now considered a code smell to ever write "new" or "delete" in your code. Imagine that, never using these words to manually allocate and delete memory in C++! But it's true, unique_ptr in particular makes so much simpler and safer.

Type inference with auto doesn't just save typing, it improves performance in many cases and reduces a lot of complexity, while also avoiding uninitialized variables.

These are just a few of at least a dozen examples that come to mind about reducing code complexity with more modern C++ features.

parent jb1991 7 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton