Live data from Hacker News

Ask HN: Is it worth investing in learning Rust?

news.ycombinator.com

31–40 of 82 posts

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

#33

Earlier quoted context omitted.

Rust and OOP are no more related than Go and OOP. What "advanced" OOP features of Rust are you talking about?

Then I must have gotten the wrong idea. I saw a few examples of Rust code with a good amount of generics sprinkled in and given what (seemed to me) the parent comment was suggesting, I assumed that was the case. That said, I remember reading in the docs about many usually OOP related concepts like RAII, boxing/unboxing, operator overloading, the aforementioned generics. You mostly don't care about these things in Go.…

No!

- Parametric polymorpism isn't OOP, pretty much every halfway-decent language has it (including Haskell, which is as functional as they come).

- Boxing in Rust isn't what you think it is - it's just heap allocation (more like malloc than the monstrosity that is boxing in Java).

- Again, operator overloading isn't OOP either. Seriously, is it that hard to believe that "you get to use + and - with your own types" is an expectation independent of any paradigm?

> I must have gotten the wrong idea.

Yes. Go and Rust are both very far from what most people would consider "OOP".

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

#34
> I'm really struggling between going for Go or Rust.

If you want to pick a skill to put on your CV I would recommend Go.

If you want expand your knowledge of programming paradigms I would recommend Rust. As a side note you will also be able to put it on your CV.

edit: for the down voter, what boundaries in language design did golang push? Unlike Rust with its unique memory management?

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

#35
post #26

Many things are worth investing in, if you justify it. The case between Rust and Go is an interesting one, as many of us have observed that the two languages seem to get paired together (for people wanting to learn). I wanted to start learning both beyond the basics, about 2 years ago. A few weeks ago I decided to write my Hello World in Rust, and I've been hooked. What I'd advise is for you to have a use-case that y…

My advice would be to not just focus on a use case, but actually have a small "starter project" in mind that you can prototype an MVP for.

My starter project[1] was a set of bindings for pandoc-types, so you can manipulate Pandoc ASTs in Rust. It's a very small library, but it's enough to plausibly do something interesting. It's also big enough to get me to play with serde and some serialization stuff in Rust. So it was a pretty good size to start with.

https://github.com/elliottslaughter/rust-pandoc-types

[1]: Technically, I did work in Rust prior to this, but it was all long before 1.0, so I had to relearn when I picked it back up.

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

#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 the language is a problem. I'd hoped Rust would kill off C++, but that's not happening.

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

#37
I have written non-trivial code in Rust and Go. The thing about Rust is that it needs a bit of perseverance and experience of writing a bit of non-trivial code in Rust to really appreciate it. Writing tutorial like code won't cut it.

Life-cycle of a Rust developer: https://imgur.com/kNkV7jm

Good, bad and the ugly: https://imgur.com/udNcZXa

With Go, in my head it is best explained in terms of the scene in the movie: Pursuit of Happyness

Boss: Chris. What would you say if a guy walked in for an interview, without a shirt on, and I hired him? What would you say?

Chris Gardner: He must have had on some really nice pants.

People (including me) find lot of issues with Go in terms of some choices in the language. But boy it does have some really nice pants and that is the ease of writing networking services + Go routines

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

#38
Having thought about this myself; the main thing I would note is that I am seeing more and more companies start to write things in rust. It seems on a definite uptrend.

So there is quite possibly work for you in the field, especially since its emerging, you could be in early.

Having said that golang is also on the up and up and probably currently there is more work I would guess; but obviously also more competition.

Lastly; to the average person like myself who is half-sysadmin half-developer (I'm not a software engineer, but I can read and write many languages "well enough") -- Rust is definitely more complex from my small amount of playing both in Syntax and basic things you need to do to "get started" -- I am sure these would evaporate quickly once you actually learn it properly early on but if you have little other language experience you may struggle with it a little as a 'first' language. Where-as go feels a little more script-like and a little easier to "bounce off the walls" in early learning.

So; is it worth learning? IMHO, yes. Is it the best choice? That may depend a little on your previous programming experience and what job market you are in (for example probably easier to find an onsite job doing rust in Los Angeles, USA than Perth, Australia)

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

#39
Yes, it is worth investing in learning Rust. As is learning Go. Which depends on what you want to learn and what you already know.

I like to learn languages like building a toolbox. I try to pick up popular, well known tools that don't have a ton of overlap with my existing tools. My go-tos: Java, Python, and C can get you pretty far. Go is a great statically compiled, GC language, with decent memory layout control and with a good concurrency story and a nifty type system (coming from Java). Rust has novel borrow-checker that's probably worth learning and seems to let you solve tasks suited for C but with more structured types and a better/simpler multi-threading story.

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

#40
post #10

Earlier quoted context omitted.

Can you explain please why is that ? btw I'm coming from a JS/Node background, but I worked with C and C++ before (mainly school projects, nothing serious).

Maybe I can try to chime in: Go is not an OOP language, you get the dot notation on structs and that's pretty much it. Rust is all about advanced OOP and very fussy static type checking. That said, IMHO, Go to me feels more like a replacement for Node more than a replacement for C.

Have you ever used Rust? it is not object oriented at all. It uses Traits (kinda like interfaces) for generic programming.

If you don't know, please don't muddy the waters.

Post reply on HN