4 ms·
Sadly rust lack some big features that c++ has like polymorphic inheritance, function overriding and function overloading.
by The_rationalist 7y ago
Sadly rust lack some big features that c++ has like polymorphic inheritance, function overriding and function overloading.
- SaxonRobber 7y agoI think that is for the best. I prefer less implicit behaviour in my code, even if it means my identifiers get longer.
- NotCamelCase 7y agoRust doesn't have function/operator overloading yet or it won't have it at all? I am vastly for clarity and simplicity over vague, implicit stuff but doing e.g vector operations can get very unreadable very quickly without it.
- pjmlp 7y agoRust has operator overloading, https://doc.rust-lang.org/rust-by-example/trait/ops.html https://doc.rust-lang.org/rust-by-example/trait/ops.html
- SaxonRobber 7y agoVector operations are one of the few cases where I think operator overloading is sometimes a good idea.
- adev_ 7y agoThat's a design choice. Less implicit means safer but also more verbose and more cumbersome to write. Rust priorities safety over everything else, also over productivity too in some case. Absence of function overloading and automatic type conversion is a good example of that in Rust. Is it the right choice ? Only time and multi-million line codebase will tell us.
- the_why_of_y 7y agoRust has "function overloading: the good parts" in the form of traits, inspired by Haskell's typeclasses. Rust does not provide the facility to strategically obfuscate code at scale like C++-style function overloading does.