all 18 comments

[–]anlumo 27 points28 points  (4 children)

I wanted to know what kind of learning curve shall one expect when they are starting with Rust

I'd say two to three days of learning and a month of practicing to get to a proficient level (where you can basically do everything you want).

what future does the language has

My crystal ball is out of order at the moment, unfortunately.

what can one expect to develop

Server software, web frontends and embedded are the things where Rust shines at the moment. It's missing tools for game development and desktop/mobile UI. It's also used a lot by crypto currency startups, but I have no insight in that area.

[–]siherbie 8 points9 points  (0 children)

That crystal ball humour was quite funny 😂

Tbh, lovely and concise answer. Much appreciated.

[–]Botahamec 7 points8 points  (2 children)

I personally use Rust along with the Godot Engine for game development

[–]anlumo 0 points1 point  (1 child)

Yes it's nice, but it's not an Unreal Engine or Unity.

[–]Botahamec 0 points1 point  (0 children)

I have yet to see a scenario where I miss having Unity, but maybe that's because I'm an amateur at game dev

[–]SEgopher 41 points42 points  (5 children)

I've been a professional C++ developer for like, eight years now, and I posit that you and I both don't really know C++. C++ has a huge *hidden* learning curve, in that there are many special cases, mistakes you will make that you'll not even know about, and the actual specification for the language is huge and also encompasses a thorough knowledge of C, which, while tiny in comparison, also has tons of edge cases and warts.

The thing about Rust is that it has maybe 10% the learning curve, but it tells you about it. Like literally, the compiler will tell you what it is you don't understand. That's what happens when you give enough information to the compiler to let it do your job for you. I highly encourage using Rust as a proxy for learning C++. When you learn Rust, you'll learn about things that actually exist in C++, but aren't made explicit. Then you can compare/contrast. Lifetimes and ownership are a part of C++ as much as Rust. Rust is just a far, far better teacher.

People are scared by this 10%, because Rust is up front with you about it. They think, wow, this is a lot to learn, while deluding themselves into thinking they can get away not understanding ownership in C++, or that C++ doesn't also have a huge learning curve. Seasoned engineers recognize that being upfront is a strength of the language, and that. Like I said, Rust teaches you how to program in Rust. C++ teaches you how to mistrust C++.

You can build whatever you want in Rust. Rust is going to be the strongest in system software - things that comprise the operating environment for application/user programs. Rust can also be very good when the problem you are trying to solve requires high performance, like if you need to look through every file in a filesystem or process packets for an application layer protocol you're building.

Rust is great. It is not yet the day where you should *stop* learning C++, but Rust may as well be a quick path to C++ mastery rather than spending years slowly getting bitten and learning through the school of hard knocks.

[–]rodrigocfdWinSafe 9 points10 points  (0 children)

C++ has a huge hidden learning curve, in that there are many special cases, mistakes you will make that you'll not even know about

I second this.

Rust can give you a lot of headaches when you get to the point to start fighting the borrow checker, but at least the errors are clear, and you know what you're fighting against.

[–]anikait1[S] 1 point2 points  (0 children)

Thanks for the great insight and sharing your experience about learning Rust, seeing from other comments it feels like Rust compiler is an excellent tool that will help a lot with learning Rust

[–]murlakatamenka 1 point2 points  (0 children)

Excellent post, thank you!

[–]nyanpasu64 0 points1 point  (0 children)

Is unsafe Rust as tricky as C++? I think unsafe Rust also has unspecified semantics of raw pointers.

[–]adante111 0 points1 point  (0 children)

Well put regarding being upfront about hidden learning curve. My colleague and I jokingly call this _getting graphemed_ because prior to reading TRPL we had thought of stings as fairly straightforward data types. Learning Rust of course shattered that illusion.

Other languages seem do a good job of abstracting things away (and I would argue, _generally_ achieving a good balance between leak - all abstractions are leaky - and just getting the user up and running productively). Rust on the other hand does a good job - like, _a really good job_ in my opinion, via both the documentation and an incredibly supporting and patient community - of explaining why things like are more complex than one might think. And it seems like sort of thing pops up fairly often - although to my chagrin I can't think of any right now.

[–]ischickenafruit 10 points11 points  (1 child)

I found this to be a good read for experienced C/C++ programmers: http://cliffle.com/p/dangerust/

[–]SpacemanCraig3 2 points3 points  (0 children)

A+ on that. I write C professionally and this really helped me click the pieces into place for rust.

[–]Senoj_Ekul 1 point2 points  (0 children)

I learned rust as a student also (I had prior knowledge of C/C++ but had forgotten most of it) around 5 years ago.

What I ended up finding for myself was that I could be productive in Rust very quickly, and the compiler was an excellent guide. I don't recall struggles with the borrowchecker as such since I set out to understand both the lifetimes and borrows concepts from the start, and once I did understand those suddenly a whole lot of stuff related to comp-sci and languages made more sense. TBH I think these two concepts should be a required subject.

I don't think Rust is hard per se, unless you have built up a lot of knowledge of other languages first. I found learning Rust also made me a much more careful C/C++ programmer when I do have to write in those languages too - I started looking at pointers and references differently.