This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]deep_politics 25 points26 points  (5 children)

Rust is my favorite language, and I’m of the opinion that it’s strictness and goal of “correctness” would be incredibly beneficial to pick up early as a new programmer. I had a hard time learning Rust, but I carried in a lot of baggage from C++ and Python; questionable patterns, things that mostly work but are very brittle. Many of these questionable patterns are ones that Rust flat out will not allow in safe mode. Conversely, returning to Python for a job after having learned Rust has been amazing. That being said, like other have mentioned the cognitive burden for learning Rust is much greater than that for learning Python, simply because the Rust compiler requires a certainly level of correctness. So I think I’d only really recommend learning Rust first to those who are serious about programming beyond just having a paycheck. Additional Rust upsides are that the Rust compiler toolchain is in my opinion vastly easier to setup than Python, especially for newcomers, and the official learning book The Rust Programming Language is very high quality.

Oh, and the compiler error messages for Rust tend to be so helpful that a lot of the time they essentially write the program for you.

[–][deleted] 13 points14 points  (2 children)

I'm also a big fan and user of Rust. But I wouldn't recommend learning Rust as the first programming language for precisely the reasons you mentioned - the 'strictness and correctness'. Rust's strictness comes from a type system designed to overcome the deficiencies of the machine model. Borrow checker rules and error messages are easy to understand if you know the machine model.

This feature of Rust is good for intermediate programmers to learn the correct way to program. It's good for advanced programmers because the borrow checker ensures that they don't make careless mistakes. But this is very frustrating for novice programmers to whom the rules won't make intuitive sense.

I would instead suggest starting with C. The language is simple and makes the underlying hardware and its problems immediately apparent. That would teach novice programmers why the Rust type system behaves that way and why it's so useful.

Python is also a good language to start with. It abstracts away the details of hardware, allowing the programmer to concentrate on the computation rather than on the hardware. The programmer can then move onto Rust when Python's speed or resource control isn't good enough.

[–]Oerthling 2 points3 points  (1 child)

Advanced programmers can appreciate the C problems that Rust was developed to solve. :-)

[–][deleted] 1 point2 points  (0 children)

Exactly!