I used to be a huge fan of C++. I loved how you could work with a somewhat OO language while still wielding dark powers like: manual memory management, mix-n-match polymorphism (aka. virtual inheritance), templates, type-erasing.
Then I got a full time job working with a large C++ codebase. Since then I've been dealing with:
- uninitialized variables / members
- NULL checks
- buffer overflows, especially with C-strings
- (mutable) global variables
- exception safety
All these things don't exist in (safe) Rust. I'm sold.
Foot note: the only thing I'm really missing in Rust right now is specialization in generics, which is being worked on here: https://github.com/rust-lang/rust/issues/31844.
Re:Announcing Rust 1.20
by PopsiclePete on Thursday August 31, 2017 @06:27PM
(#15144509)
That's my main beef with C++. You read a book and it's beautiful - no uninitialized memory, safety, no C arrays/strings, RAII everywhere, it's clean, fast.....then you get to the "real world" and realize that 99% of C++ programmers are pretty f###ing horrible at their job and should've just stuck to naked C because at least then you'd be able to pin-point the bugs easier.
So C++ is a wonderful language - in a world that only exists in the creators' heads, or on committee tables, or on brand-new, post C++03 codebases. Basically - nowhere.
Most large C++ code-bases predate C++11, which was really game-changing.
But isn't that the case with basically ANY programming language? Once its use becomes widespread, escaping the confines of the highly skilled early adapters, you can be sure a whole lot of dodgy code will be written in it.
Not really, because the language doesn't make it difficult to write dodgy code and gives you no power to easily find such dodgy code. In other safe languages either you simply can't write these kind of dangerous code or it should be easier to catch them with just keyword search. In C++ you need powerful static analysis and some dynamic instrumentation to hopefully catch them.
Re:Announcing Rust 1.20
by trapperkeeper74 on Thursday August 31, 2017 @02:59PM
(#15142837)
Maybe by "pleasure" they mean "obscurity, gotchas and complexity are pleasurable because they trip up newbies and lend themselves to job security."
If there's one thing we C++ programmers can agree on, it's that having tons of features makes C++ a pleasure to work with... ?