5 ms·
> I plan on writing several posts about Rust features, why they’re an improvement upon C++ features, and why Rust is a better, more modern programming language.
by CyberRabbi 5y ago
> I plan on writing several posts about Rust features, why they’re an improvement upon C++ features, and why Rust is a better, more modern programming language.
I’m always impressed that Rust turns people into such devoted evangelists after relatively little experience with it. This is a testament to its quality.
- usrnm 5y agoIf JavaScript frameworks taught us anything, it's that people tend to fall for "new and shiny" much more willingly, than for anything related to quality.
- MaxBarraclough 5y agoI think that's at least somewhat particular to the web, though. Plenty of 'C++ people' have been doing C++ for decades.
- ioseph 5y agoI'm not too sure that's still the case in the javascript world. React is coming on to 10 years and still remains the most beloved framework.
- rapsey 5y agoRust is not that new and shiny anymore.
- nlitened 5y agoIt has a new edition every year though :)
- rapsey 5y agoNo it does not. 2015, 2018, 2021. With the 2021 changes so small few projects actually required any changes to be compatible from 2018.
- nindalf 5y agoThe 2021 changes could be applied with an autofix tool - “cargo fix --edition”. Most of these changes are small paper cuts that make sense to fix, but they’re breaking changes so they need to be opted into explicitly. For example, earlier use a field x of struct b in a closure would capture the ownership of the whole of b. In rust 2021, the closure will only take ownership of b.x. This makes sense, but it’s a breaking change and therefore it needs an opt-in. The Edition system is one of Rust’s biggest strengths IMO. Some languages never make breaking changes be enough if they’re small because it would break too much code. Other languages make breaking changes but expect users to migrate, placing a burden on them. The Rust edition system leaves it up to the user, on a per-crate (package) basis. Staying on the old edition is perfectly acceptable, as is moving to the new one. Further reading - https://doc.rust-lang.org/edition-guide/rust-2021/ https://doc.rust-lang.org/edition-guide/rust-2021/
- GolDDranks 5y ago*every three years, actually. The current one is 2021, the one before that was 2018 and the (implicit) first one 2015.
- nindalf 5y agoMaybe that’s why they named it Rust. It sounds old and boring.
- FridgeSeal 5y agoFor a bit of trivia, I believe it’s named after a fungus.
- jayflux 5y agoThat’s not really what was happening in the JavaScript world though. It was a new ecosystem trying to figure itself out, and it takes quite a few attempts to do that. Both react and vue are near 10 years old, express is over 10 years, so it’s not “new and shiny” chasing. Rust will go through the same thing before the dust settles.
- flyinglizard 5y agoThat’s a very kind interpretation.
- rmnclmnt 5y agoWhen reading the Rust Book and coming from a C++ background, it feels like every chapter brings a solution to an issue you have encountered previously. So yeah I think this gives C++ programmers hope to not lose too much hair anymore! (C++ made me bald the first 5 years!)
- jstx1 5y agoWhen I see someone very devoted to a programming language, I see it as a sign that they might have problem with their perspective, not as a testament to the language's quality. Rust might be great (I don't know) but this aspect of the community makes me less likely to try the language, not more.
- gefhfff 5y agoWhy? ( I didn't care a bit about this aspect when I approached Rust )
- mgaunard 5y agoThe reality is that programming with a language like Rust or C++ takes a higher level of expertise, those are more sophisticated tools than web technology. You need to invest a lot more to use the tool well, but then the tool can do a lot more.
- tialaramex 5y agoIt's the first new language I've learned (in let's call it 30 years of programming, not counting Turtle Logo or self-taught BASIC) which made me want to rewrite my programs. I quite like several languages I learned, Java, Python, even C# is rather nice in some ways, others didn't make a dent, Scheme I had actually forgotten until I was asked about old Scheme code I wrote, ML was nice but too abstract for me... I am learning PowerShell at the moment for some reason, I can't say I'm fond. However I never had any inclination to go back and rewrite software. The software already works, why change language? But I've already spent a bunch of time doing that in Rust because it's so much nicer than the C I wrote a lot of software in previously. It's not just the language itself, which is pleasant, the tooling is excellent as well. I spent part of Sunday pair-debugging a friend's Perl AoC solution (it worked for the test input but not real inputs, that's a fun story) and they lamented that early on they'd forgotten to have revision control. When you ask Rust's cargo for a new project, it automatically creates you a git repository (if git is available) for the project, and if you didn't say you're making a library it gifts you a "Hello, world." example program to start with. The error messages are excellent. The developers actually put effort into further refining the already excellent error messages. After a long day writing SQL Server queries for which the response is typically "Syntax error" if you got anything wrong like this is still 1975, it's really nice to write a line of Rust that's wrong and have the compiler explain why it's wrong. The documentation is lovely. The official documentation for the standard library is in the exact same style as auto-generated docs for your own code. Because why wouldn't you do that? Java more or less did this and I appreciated it then, but writing such docs for Java is much more painful, and yet the results are less useful. C# is similar. I believe Swift got nice documentation behaviour in a recent version but I don't know Swift.