3 ms·
I write C++ for a living and I admit I do like to push it to its limits (SFINAE, constexpr/type traits shenanigans, the more the merrier), but it must be acknow
by qalmakka 4y ago
I write C++ for a living and I admit I do like to push it to its limits (SFINAE, constexpr/type traits shenanigans, the more the merrier), but it must be acknowledged that it tends to become too much akin to magic the more you push the envelope. Stuff like having 10 kinds of initialization and name resolution being incredibly complex and convoluted is a bit more confusing than what should be considered acceptable in a programming language.
Still I love the utter madness that there's behind C++, and the fact you can basically do everything you set yourself to, no matter how crazy and weird it is, as long as you accept to put up with the madness. You can emulate a good 90% of what Rust does with traits if you really want to.
- FpUser 4y ago>"I write C++ for a living and I admit I do like to push it to its limits (SFINAE, constexpr/type traits shenanigans, the more the merrier)," I suspect maybe because you love programming as a process. I write C++ (other languages as well) for living but I am my own company, so my primary concern is to deliver more while spending less. The language on it's own means zilch to me as long as it adequate.
- qalmakka 4y agoWell, by pushing C++ you can enforce a lot of constraints at compile time, just like you do with Rust. For instance, by extensively using concepts or SFINAE (enable_if and friends) you can make type safe code that works well and (almost) never breaks. I rarely if ever need to fix runtime issues with my C++ (or Rust), because it almost always works at the first attempt. That's due to all the "fighting against the compiler" you need to do beforehand in order to get the code to compile in the first place, but it's generally worth the effort IMHO.
- deleted 4y ago[deleted]