4 ms·
I often see "steep learning curve" cited as a negative about Rust. But I think it is far less of a learning curve than it is to be a reliable C and C++ program
by onebot 7y ago
I often see "steep learning curve" cited as a negative about Rust. But I think it is far less of a learning curve than it is to be a reliable C and C++ programmer.
I am not sure how much Rust you have done yet, but the borrow checker is a tremendous confidence booster. Especially refactoring code. I have never had anything where I can feel at ease in making big changes to an existing code base. As all things, I don't think you notice it once you learn how to write safe Rust code.
Go is certainly a good balance. One of its best things is the rich standard library. I wish Rust took more of that approach.
One thing about Rust that is maybe overlooked is that it is, like C/C++, truly "full-stack". By that I mean you can go from low level embedded (microcontroller with no MMU) all the way up to web server, etc. I don't think it is really a "niche" language--at least it has a very horizontal use case.
Having been at this for a super long time, I have seen the popularity languages come and go from ASM, Perl, Java, Python, .Net, etc. I can assure you nothing is gonna "quickly" make another language obsolete. New languages are incredibly hard to get off the ground and be relevant for a long time.
- EpicEng 7y ago>I often see "steep learning curve" cited as a negative about Rust. But I think it is far less of a learning curve than it is to be a reliable C and C++ programmer. Man of us are already competent in C and/or C++, so to make a move there has to be a big value prop if it's a large investment. I'm not saying there's not, but most of us aren't deciding to pick up C, C++ or Rust from scratch.
- onebot 7y agoYeah totally agree for the experienced C/C++ developer, it is like unlearning all the things that make you good. Totally agree. Good developer is like building a series of great mental models. It is hard to start over. Like trying to do linked lists in Rust... But that being said, when you see that the majority of vulnerabilities are essentially memory lifetime issues (https://msrc-blog.microsoft.com/2019/07/22/why-rust-for-safe-systems-programming/ https://msrc-blog.microsoft.com/2019/07/22/why-rust-for-safe...), you realize that we are all human. So something like Rust could help--especially new developers.
- holy_city 7y agoI think Rust adoption has pointed out that the idea of safe C/C++ developers are a myth. It's an appeal to authority to be sure, but if Intel and Microsoft (and others, but those two have talked about it) are finding that their security-conscious C/C++ developers are still putting memory safety bugs into production - there's an argument that the idea of "competent" use of C/C++ for safety critical is possible (in general) needs to be brought into question. On a personal note, learning Rust has made me a much better C++ developer. I'm more conscious of various degrees of aliasing and multiple ownership, to the point where much of the C++ I've written of late is inspired by the borrow checker's conventions. And since what I do is usually executed concurrently, I've seen a concrete decrease in bug count and severity without cost in performance. Which means the time investment in learning Rust has paid off, in my opinion.
- pjmlp 7y agoWhile I agree, and I do like Rust, C++ still has a winning hand for those of us on Java/.NET. Just to give a possible example, given everything that Microsoft has been doing about Rust. On what concerns Windows systems programming, Rust must be able to integrate with .NET, allow mixed mode debugging, authoring of COM/UWP, use of the GUI frameworks, just as easy as VC++ allows us to. So I am eager to get to know about whatever Microsoft might announce in this regard.
- holy_city 7y agoYou can integrate with COM already through winapi [1] (and author your own COM objects too with com-impl[2]). GUI stuff is still a long way from being useful, but a huge chunk of code has nothing to do with UIs. And Rust can integrate with anything that can call C. w.r.t debugging, I haven't had much trouble mixing with C++ but I haven't tried to do anything through C#. [1] https://github.com/retep998/winapi-rs https://github.com/retep998/winapi-rs [2] https://github.com/Connicpu/com-impl https://github.com/Connicpu/com-impl
- pjmlp 7y agoYou can also make fire with two stones. That is the difference between using C++/CX, C++/WinRT or the existing Rust libraries. So how do you integrate Rust with VS debugging tools?
- atoav 7y agoThis reflects the feelings I had when I tried Rust for a few side projects. I read everything I could and did all the tutorials, but I still felt there was some sort of invisible glas wall between me and enlightenment. I tried very hard to program in structures I thought I had to use, mainly out of experience from other languages (OOP...) At some point the friction just grew too hard and I said to myself: "Ok you stupid Rust, I will do it your way, I just want this to work" and then it made click and everything fell into place – builder patterns, traits, composition over inheritence – I realized that clinging to all the patterns I had learned was idiotic, because Rust has given me maybe even more powerful ways of expressing myself. If it wasn't for the friendly Compiler yelling at me, I doubt I would've gotten so far.
- dan_quixote 7y ago> I am not sure how much Rust you have done yet, but the borrow checker is a tremendous confidence booster I recently spent an entire week diving into Rust for a personal project. While it certainly had a learning curve that slowed me down (particularly regarding the borrow checker), I realized that I only had 1(!) runtime error all week...in a language I was unfamiliar with. That gave me a huge amount of confidence in memory safety.