Hacker News new | ask | show | jobs
by Althorion 2662 days ago
I don’t know… I’d rather say that learning curve is more of a journey from ‘I can write code’ through ‘I can write code that compiles’, ‘I can write code that works’, ‘I can write code that works well’ to ‘I can write code that works well and is readable’ and certainly the first few steps are much harder in Rust than in C or even C++, so I’d call that a steeper learning curve.
2 comments

One thing to note is that the claim wasn't "shallower" but "fantastic". A sufficient response to this is that it's "fantastic" because the vertical distance between "can write code that compiles and looks reasonable" to "can write code that is reasonably correct" is small. I doubt you would find many other languages where that area is so small in fact (Idris comes to mind).

I'd also argue though that while the learning curve for rust is initially steeper, it is shallower when you look at the curve up to the point where you want contributors to be. C/C++ has an insanely steep cliff to go from "can write reasonable looking code" to "can write reasonable correct code".

The first argument is in some sense better because it doesn't restrict me to talking about C/C++.

A few points on that:

- Rust skips (or almost skips) some of those steps. If you can write code that compiles, you can also write code that works. It forces you to be very specific about your intentions, which isn't possible in language with less-thorough type systems and compile-time checks.

- I agree that the curve is steeper at first, but it's arguably impossible to write code that "works well and is readable" in C/C++ (which is why we have Rust in the first place). That makes the latter part of the learning curve an asymptote.

> Rust skips (or almost skips) some of those steps. If you can write code that compiles, you can also write code that works. It forces you to be very specific about your intentions, which isn't possible in language with less-thorough type systems and compile-time checks.

Forcing new programmers to be specific about intentions they may not even know they are supposed to have doesn't necessarily work.

> I agree that the curve is steeper at first, but it's arguably impossible to write code that "works well and is readable" in C/C++ (which is why we have Rust in the first place). That makes the latter part of the learning curve an asymptote.

I don't agree with your analysis of "works wells and is readable". It's not too to write C code that works well and is readable. Sure, your code might occasionally break–but the point is that it works most of the time. This isn't necessarily a good mindset to have as a software engineer, but with regards to the specific claim that Rust is easier than C: it's not, because it enforces better practices, which is mental overhead and complexity that C doesn't need to deal with.

> Forcing new programmers to be specific about intentions they may not even know they are supposed to have doesn't necessarily work.

Rust is not a good language for new programmers. Neither is C for that matter. You shouldn't start learning Rust before you have solid intuitions of programming concepts like ownership, scope and mutability.

And thus the steep learning curve.
It doesn't make sense to assess the learning curve of a language when you're also intermixing learning to code...

It's like saying a plane is "harder to learn to fly than other planes" just because a beginner can't learn to fly it quickly.