Hacker News .hnnew | past | comments | ask | show | jobs | submitlogin

I have to massively disagree here. I'm far more confident about code written in the modern style of C++ than I am in old school C++.

Modern C++ with RAII, smart pointers, constexpr, concepts, and heavy instrumentation is so much easier to reason about. It's actually close to Alexander Stepanov's idealised C++.



Maybe we're talking about different subsets of C++.

IIUC, you're referring to codebases which limit themselves to what's often called "modern C++".

I'm working with codebases that draw from a gnarly combination of older and newer parts of the current language spec.

So in my experience, very few C++ programmers are familiar with every part of the current language spec that has relevance to these codebases.

I.e., their code isn't obviously correct regarding many aspects of correctness, including memory safety.


I can only partially agree. The new stuff often breaks in much nastier ways when it does eventually break. The worst of that old school C with objects code (and the toolchains that built it) can be dissected using simple tools and a lot of single stepping. Even when things miscompiled, you had a reasonable shot of figuring out the boundary conditions so you could avoid it in the future.

A lot of the modern stuff isn't like that. There's a thousand different rules governing ten thousand different constructs that interact in fun and dangerous ways.




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

Search: