Live data from Hacker News

Ask HN: Is it worth investing in learning Rust?

news.ycombinator.com

71–80 of 82 posts

Re: Ask HN: Is it worth investing in learning Rust?

#71
I spent around 30 minutes reading "Rust for functional programmers" [1] to get overall perspective and then around 3 hours more reading selected chapters from "The Book" [2] about borrowing, lifetimes etc.

Then I managed to write a simple program which reads a password from stdin, applies scrypt KDF to it and prints the result in hex encoding. It took me less than 2 hours. Mostly I just tried to do something, and when it didn't work, I'd find a solution for my problem on stackoverflow or r/rust. Compiler error messages were also quite helpful.

So I managed to write a useful (for me) simple CLI application in 1 day. The next day I added option processing (salt, scrypt parameters), split the code into functions etc. I didn't encounter any problem which I couldn't solve in under 1 hour. The biggest struggle was trying to return a reference to local variable from function, and it was covered in [3].

TLDR: don't try to master the language, just give it a try for a few days, writing a simple program.

[1] http://science.raphael.poss.name/rust-for-functional-program...

[2] https://doc.rust-lang.org/book/

[3] https://bryce.fisher-fleig.org/blog/strategies-for-returning...

Re: Ask HN: Is it worth investing in learning Rust?

#72
post #36

Depends on what you're doing. If you're doing web backend stuff, use Go. That's what it's for, and it has solid libraries for that because Google uses them internally. Go is reasonably easy to learn - it's just not that big. Rust is fascinating, but there's just so much stuff in there. The borrow checker is a major advance, but unless you're doing heavy parallelism or can't use garbage collection, the complexity of t…

No language has ever "killed off" any language as popular as C++. Perl isn't dead yet. C hasn't even killed COBOL and Fortran.

Anyway, if Rust doesn't unseat C++, of all languages, it won't be because of language complexity. There's very little complexity in Rust that isn't inherent to the language goals anyway.

Re: Ask HN: Is it worth investing in learning Rust?

#73
post #53
post #51

Earlier quoted context omitted.

What does "error management story" refer to in the second pic?

For some time the dominant error handling way was 'error-chain' crate and the comment was made in that context. Now there is a failure crate https://github.com/withoutboats/failure . It is an improvement, but it still feels that one has to type a lot for something basic. Now, this is a matter of taste and many people will be ok with this.

Note that if verbosity of error handling is a problem for you, you definitely should not use Go.

Re: Ask HN: Is it worth investing in learning Rust?

#74
post #70
post #64

Earlier quoted context omitted.

> Good, bad and the ugly: https://imgur.com/udNcZXa What does "Development experience is very intense" mean?

An example: So suppose you have the following pseudo code: x = f() In other languages you start using 'x' straight away. You can call member functions on it, compare it, etc. In Rust if x happens to be of type Option or Result (which are wrapper types i.e. they wrap the value), then you need to understand these first very well to write idiomatic Rust code. These types have combinator functions like 'map', 'and', 'and…

Thank you!

Re: Ask HN: Is it worth investing in learning Rust?

#75
post #3

Learn both, Rust is a great general purpose language that can be used to build almost anything. Go is a great general purpose language that can build a nice set of things. If you need to, you can even use Rust to build firmware, boot loaders, kernel drivers, user mode drivers and operating systems. Basically anything that you want to run fast and have less errors Rust would be a pretty good choice to use, especially…

Yes, on the performance side of things, Rust is blazing fast, but the learning curve is hard though, that's why I'm wondering if it's really beneficial for me as a programmer especially in the long run, since it's not used widely in the moment.

> I'm wondering if it's really beneficial for me as a programmer

I'm biased since I love programming in Rust, but I think learning the ownership model (the trickiest part for most people) is beneficial for programming in any language. It builds up a really good intuition: If only one reference exists to an object, or if shared references exist but they're all read-only, then that's "business as usual". But as soon as you have shared references and mutability at the same time, then you have "very interesting code". Even in a language other than Rust, where you don't need special types to let you do that, the situation probably deserves some beefy block comments where you warn everyone to pay attention.

Re: Ask HN: Is it worth investing in learning Rust?

#77
post #67

Earlier quoted context omitted.

> to learn both and switching is a necessary skill if you want to program professionally There is a hoard of professional Java or C# developers that invalidate the idea that you need to know more then one language to program professionally. While this might seem odd to a hn reader, where there is weekly blog posts of comparing languages or trying out the new shiny thing at a startup. One need to remember the audience…

My advice is sound for anyone working as a programmer because it gives them more options. Many of those Java/C# devs are stigmatized in a mold and will have more trouble applying to jobs outside large enterprise.

My last job was for a small startup.

They used Java. The rest of my programming jobs, -large and small, has been either Java, PHP, .Net and once a bit of Delphi. Lately there's also been a lot of TypeScript.

There's been a few jobs I wanted to apply for but couldn't because I'm not good enough with C/C++ and Qt.

Maybe things are different in Silicon Valley but around here the most exotic language I see is Python.

Re: Ask HN: Is it worth investing in learning Rust?

#78
post #66

The answer depends on who you are, what you've done, and what your goals are. Developing a Rust skillset is absolutely an investment-- but is it a worthwhile investment for you ?

To rephrase Dowwie's point: It's an investment. What would "return on investment" look like to you?

Knowing a new way to think about code? Rust is probably worth it for that, even if you never actually use Rust much. Go is less of a new way of thinking.

Increasing your ability to get hired (or you paycheck when you do)? I'm less clear that you'll get paid back in those terms. Go might be a better bet.

Scratch the itch that you like learning new things? Well, if you learn Rust (or any language), sure.

Re: Ask HN: Is it worth investing in learning Rust?

#79
post #61

Earlier quoted context omitted.

Yes the second point is exactly what I was getting at - how exactly is Rust so much better that it justifies to learn it instead of C++. (but I don't imply it isn't, just curious to see some real points).

AFAIK, the design goals of Rust are better security and correctness in general, than C++. Have you looked at Rust and decided that it does not achieve that goal?

If I'm starting my own project, then I can pick the language that I think gives me a better shot at security and correctness. If Rust is better than C++ at that, and if that's my criterion for picking a language, then knowing Rust opens new doors for me.

If someone hires me to work on a project, in the current state of affairs, they're much more likely to have picked C++ than Rust, and I don't get the choice (other than choosing whether to take the job). Rust doesn't (yet) open that many doors for me as an employee.

Re: Ask HN: Is it worth investing in learning Rust?

#80
post #48
post #18

Earlier quoted context omitted.

> If you want to build a game, or want a superior c++, go for Rust. Does Rust have the libraries, frameworks, engines, and communities for developing games? In my opinion, development of any software, whether it's a REST API or a AAA 3D game, isn't just about the language but is actually about 10 other things.

If you want to make a 3D game you can get started much quicker by using an existing engine like Unity and C#. If you’re interested in building a game engine then C++ will have the most resources.

That's what I'm thinking, yes.
Post reply on HN