If you have a constant expression like 1 + 2 in your code you can evaluate it at compile time once and avoid computing it at runtime. You can do that with control flow and much more complex language constructs in C++. If you want to know more about that look into C++ template meta programming, constexpr, and constval.
It’s easy to build a well-designed language when you don’t have to work around the mistakes of the past that were too difficult to solve then and too deeply entrenched to change now.
C++ has pretty much no compile-time checks, while Rust’s overengineered syntax allows it’s compiler to catch vast majority of your everyday errors during compilation.
What does that mean ?
If you have a constant expression like
1 + 2in your code you can evaluate it at compile time once and avoid computing it at runtime. You can do that with control flow and much more complex language constructs in C++. If you want to know more about that look into C++ template meta programming, constexpr, and constval.Or don’t look into those things if you wish to remain sane
Templates are cool as fuck tho… For like 5 minutes until you go insane
I get that the designers wanted to have compile time static replacement but this was not the way to do it.
yeah, zig and rust have the same concepts but much better thought and structed
It’s easy to build a well-designed language when you don’t have to work around the mistakes of the past that were too difficult to solve then and too deeply entrenched to change now.
yes, thats why I dont bother finnishing projects
To be fair, I never fully understood why programming projects have to be native Finlanders, in the end.
Translation: “We’ve made the preprocessor a first-class language feature!”
(jk, don’t kill me)
thank you !
it means rust is cool as fuck
aren’t they talking about C++ ?
C++ has pretty much no compile-time checks, while Rust’s overengineered syntax allows it’s compiler to catch vast majority of your everyday errors during compilation.
ok thanks
Rust is a very modern alternative to C /C++.
Overengineered mess