News for hackers. Stuff that matters.
Re:Ask HN: Is it worth investing in learning Rust? by segmondy on Sunday June 10, 2018 @08:52PM (#17280989)
If you are a C++ programmer, learn rust. If you are a C or other programmer, learn go.

If you are doing this for job prospects, pick go.

Re:Ask HN: Is it worth investing in learning Rust? by hamza99 on Sunday June 10, 2018 @09:48PM (#17281164)
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).
Re:Ask HN: Is it worth investing in learning Rust? by kristoff_it on Sunday June 10, 2018 @10:25PM (#17281290)
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.

Re:Ask HN: Is it worth investing in learning Rust? by frfl on Sunday June 10, 2018 @11:18PM (#17281488)
Rust isn't about advanced OOP at all. It is heavily inspired by functional programming.
Re:Ask HN: Is it worth investing in learning Rust? by rs86 on Sunday June 10, 2018 @11:39PM (#17281571)
No offense but your commentary is on the verge of being just misleading. Rust is not OOP and go is definitely not a replacement for node.
Re:Ask HN: Is it worth investing in learning Rust? by tomjakubowski on Sunday June 10, 2018 @11:13PM (#17281470)
Rust and OOP are no more related than Go and OOP. What "advanced" OOP features of Rust are you talking about?
Re:Ask HN: Is it worth investing in learning Rust? by kristoff_it on Monday June 11, 2018 @12:05AM (#17281673)
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. Can we agree that Rust is a bit more OOP oriented than Go at least?

Re:Ask HN: Is it worth investing in learning Rust? by anaphylactic on Monday June 11, 2018 @12:31AM (#17281807)
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? by kristoff_it on Monday June 11, 2018 @01:52AM (#17282126)
You make it sound like OOP is an inherently bad thing, and OOP is not mutually esclusive with FP as you seem to imply with your Haskell reference.

Funcional can be considered an alternative vs imperative and declarative, and usually languages are a mix of the three. And any of these 3 style can support OOP.

BTW, plenty of half-decent languages don't have generics.

Re:Ask HN: Is it worth investing in learning Rust? by rs86 on Monday June 11, 2018 @06:53PM (#17289328)
Objects are parametrizations of functions that possibly close over variables. Having types with functions defined in types with dot notation is a different thing.
Re:Ask HN: Is it worth investing in learning Rust? by dvainsencher on Monday June 11, 2018 @12:52AM (#17281908)
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.

Re:Ask HN: Is it worth investing in learning Rust? by oneweekwonder on Sunday June 10, 2018 @11:59PM (#17281649)
> That said, IMHO, Go to me feels more like a replacement for Node more than a replacement for C.

Except the first release of node was May 2009 and the first announcement of golang November 2009. Node was also first showcased in November 2009.

So for me golang cannot be seen as a replacement for node just from chronological order. Also their design goals at the time seems very different.

Re:Ask HN: Is it worth investing in learning Rust? by kristoff_it on Monday June 11, 2018 @02:13AM (#17282189)
I don't mean to imply that it was designed with that goal in mind (for all I know, the date you are quoting still leave ample opportunities for "cross-impollination"), but for day-to-day usage, every service that I would have written in Node in the past, I'm now writing in Go.

That, at least for me, feels not as much the "obvious" choice for C programs.