4 ms·
When you write C++ you have to know that you don't know the language. If you think you know the language - you are aiming that shotgun right at your foot. C++
by lucidguppy 4y ago
When you write C++ you have to know that you don't know the language.
If you think you know the language - you are aiming that shotgun right at your foot.
C++'s attempts to modernize usually mean adding features with maintaining backwards compatibility. It's like adding new paint to a bucket of brown paint - things never really get better.
I think the percent of programmers who can keep the language in their head all the time is very low.
There are minefields everywhere.
https://en.cppreference.com/w/cpp/container/map/operator_at https://en.cppreference.com/w/cpp/container/map/operator_at
If you try to search for something in a map - and its not there - it adds it for you. If you want it to error you have to use at
https://en.cppreference.com/w/cpp/container/map/at https://en.cppreference.com/w/cpp/container/map/at
That is just in the very well engineered standard library. What kind of code is in your company's repos? What do programmers need to keep in their heads?
Writing good C++ requires good testing, good tools, good education, good colleagues and a quasi green-field because legacy C++ is segfault...
https://www.youtube.com/watch?v=s7wLYzRJt3s https://www.youtube.com/watch?v=s7wLYzRJt3s
- pelorat 4y agoTo be honest, I'm a C++ programmer and I hate than in C# if I do Dictionary[x] that it doesn't add a default if possible.
- gpderetta 4y agoAnd python. There's a reason I often reach for defaultdict!
- pcthrowaway 4y agoC++'s attempts to modernize usually mean adding features with maintaining backwards compatibility. It's like adding new paint to a bucket of brown paint - things never really get better. I think the percent of programmers who can keep the language in their head all the time is very low. There are minefields everywhere. This is sounding a surprising amount like Javascript at this point. Not hating on JS, but it has significantly changed over the years while maintaining backwards compatibility. Looking at a codebase I can pretty much pinpoint when it was written (± 3 years). I shudder at the thought of people who onboarded in JS in the last 2 years coming across a 20-year-old codebase though.
- danbolt 4y agoI think the two languages share a lot of interesting traits, but in unique ways: - Widely deployed in a variety of contexts (web, embedded, desktop applications, etc.) - Relatively spartan standard library - Variety of build setups and toolchains (eg: Make, CMake, Bazel, Babel, gulp, etc.) - Variety of dialects and trends (eg: classes v/ prototypes, RAII, boost, handlebars.js)