4 ms·
Can you give some examples of Rust and C++ design that are over engineered?
by tines 1y ago
Can you give some examples of Rust and C++ design that are over engineered?
- uecker 1y agoFor C++, just take lambda captures, you can do [&], [=], [a], [&a], [a = b] (and I probably forgot half), the many way you can do initialization in C++ became a meme, but it really permeates the whole language whose design is driven by enthusiasts and people who have an interest to make it more complex (trainers, book authors, consultants, etc.) For Rust, I think it is a bit of a different story and it is harder to point to specific features. The language is clearly much better designed (because it was more designed and did not evolve so much) and because of its roots in functional programming. Just overall, the complexity is too high in my opinion and it a bit too idealistic and not pragmatic enough.
- LoganDark 1y ago> it a bit too idealistic and not pragmatic enough This is an ideal programming language for certain types of people. It also gives the programming language certain properties that make it useful when provable correctness is a concern (see Ferrocene).
- AlotOfReading 1y agoLast time I talked to the ferrocene people they had no plans to do anything with formal methods. Has their scope expanded?
- _flux 1y agoMaybe it was intended to refer to RustBelt. I haven't been following their work, though. It seems they are working on stacked borrows.
- steveklabnik 1y ago> I haven't been following their work, though. It seems they are working on stacked borrows. We're a few years past that, there's now 'tree borrows' which just had its paper published: https://www.ralfj.de/blog/2025/07/07/tree-borrows-paper.html https://www.ralfj.de/blog/2025/07/07/tree-borrows-paper.html
- LoganDark 1y agoSorry, I didn't mean provable correctness as in using formal methods, I meant it in terms of far stronger compiler guarantees about especially things such as memory safety. I also personally find Rust code far more pleasant to write and to reason about compared to C/C++ because of how well-defined and consistent it is.
- bfrog 1y agoThe language is highly productive, it’s pragmatic enough. There’s no perfect language until our brains can directly describe what we want a machine to do without intermediary translation layers like C.
- saagarjha 1y agoI think captures are mostly reasonable and fine (and other languages have similar constructs). Initialization is completely broken, yes.
- anon-3988 1y agoFor C++ specifically, constructors. Just have functions for gods sake.
- tines 1y agoThe question was mainly meant to elicit examples for Rust (I asked about C++ just to get a baseline of what the original commenter thinks "overengineered" means), but nobody seems to have any for Rust :)