3 ms·
C++ is like PHP: it used to be a terrible language, and you can still reach for everything terrible if you wish. But during last maybe 10 years, C++ made a lot
by nine_k 3mo ago
C++ is like PHP: it used to be a terrible language, and you can still reach for everything terrible if you wish. But during last maybe 10 years, C++ made a lot of effort to become a language with fewer footguns and more safe, high-level tools.
Still I won't start a new project in C++. If I wanted high-level features and zero-cost abstractions, I'd take Rust. If I wanted working really close to hardware, do bit-twiddling and knowing where every byte is allocated, I'd take Zig. If I wanted to write a small piece of code intended to run absolutely everywhere, including old and esoteric architectures, I would still have to go with C (plain, old).
- Panzerschrek 3mo ago> If I wanted working really close to hardware, do bit-twiddling and knowing where every byte is allocated, I'd take Zig Why not C++? It allows as many low-level operations as one wishes, but don't forces you to manage memory manually where it isn't necessary. > If I wanted to write a small piece of code intended to run absolutely everywhere GCC and Clang have support of C++ since many years. Is there any modern platform for which no GCC or Clang backend exist?
- nine_k 3mo agoWhy not C++: build system(s), stdlib, modularity (though C++20 has modules, who uses them?), presence of UD. Better languages don't carry the unfortunate baggage of 1970s which C++ needs to be compatible with.