You might claim to know C and rust but you probably know only the basics. You should get deeper into whatever language you like. Most concepts transfer really well between languages. If you understand C++ to some degree, your intuition for rust and why the language does things in the way it does it is really solid.
To awnser at least one of your questions: a lambda is nothing different than an anonymous class with a function call operator.
It works the same in probably every programming language. In rust you have closures, in c++ you have lambdas, they are lazy evaluated etc..
Same thing for classes. It’s the same concept for polymorphism everywhere. You have some dynamic dispatch with a virtual table lookup and that’s it….
View all comments
•
u/Realistic_Speaker_12 16m ago edited 12m ago
You might claim to know C and rust but you probably know only the basics. You should get deeper into whatever language you like. Most concepts transfer really well between languages. If you understand C++ to some degree, your intuition for rust and why the language does things in the way it does it is really solid.
To awnser at least one of your questions: a lambda is nothing different than an anonymous class with a function call operator.
It works the same in probably every programming language. In rust you have closures, in c++ you have lambdas, they are lazy evaluated etc..
Same thing for classes. It’s the same concept for polymorphism everywhere. You have some dynamic dispatch with a virtual table lookup and that’s it….