Re:Fun with C++26 reflection: Keyword Arguments
by orphea on Tuesday February 11, 2025 @08:16AM
(#43012388)
> the footguns in C++ are more benign
I don't think I can agree. https://pvs-studio.com/en/blog/posts/cpp/1215/
Re:Fun with C++26 reflection: Keyword Arguments
by eqvinox on Tuesday February 11, 2025 @01:05PM
(#43015982)
I'm not gonna claim C++ is a great language, just that JavaScript starts its weirdness "earlier"/"lower" than C++. Especially since a bunch of the issues listed on your linked reference are technically UB but compilers (a) can warn about it, and (b) have reigned back somewhat on exploiting UB for optimizations.
Now that I think about it, the fact that you necessarily have to use a compiler with C++ is also part of the equation here. It's basically a mandatory linter. With JavaScript as with any interpreted language there's a lot of mines you can trip over waaaaaay down the line, especially if you aren't taking steps to use linters.
Re:Fun with C++26 reflection: Keyword Arguments
by hyperhello on Tuesday February 11, 2025 @09:12AM
(#43012900)
The same tired edge cases. Especially the null pointers. Yes, but what did you want the language to do? Stop you? You can do that yourself.
Arguably this is worse than C++ because for basic things/beginner to intermediate users, the footguns in C++ are more benign (e.g. performance related, rather than correctness) than the ones in JavaScript.