Hacker News new | ask | show | jobs
by kaashif 53 days ago
C++/C#/Python absolutely do have ergonomic ways to do this (and have for decades by this point...) but programmers continue to use sentinel values. It is a bit puzzling.
1 comments

You've got two huge filters on C++ codebase quality.

First, you have the "our core libraries/dependencies were written when it was 'C with Classes' and we're going to keep using that style for consistency/laziness/because it's well-tested", and then you have the "C++ is ugly/full of segfaults/hard, I'm going to use <new language> which solves all these problems".

You have to pass those two filters before you get to people who are interested in writing good, modern C++.

Indeed, while undoubtedly we need "C++ The Good Parts", since C++17, but C++20 would be better cut, we can perfectly write Python like code in C++, while getting the performance Python will never deliver.