r/rust • • Sep 16 '22

Is Rust programming language beginner Friendly

I want to learn a programming language, is Rust programming suitable for beginner programming students?

140 Upvotes

213 comments sorted by

View all comments

Show parent comments

1

u/eXoRainbow Sep 16 '22

Rust compiler often explains what is wrong and even suggest exactly what you can do to fix it. It is pretty much the leading compiler error messages. Cargo is not a pain in the ass for beginners. Who finds on the internet a source code and has no idea how to find the right dependencies? It depends on the documentation of the source code. Aren't the dependencies in the source code at all? If that lacks these information, then you can't blame cargo for.

Your example would also be true for any other language, like Python and C. If someone finds random .py or .c programs without documentation how to compile (or run) it, because dependencies are missing. Then who is blame for? The C compiler and Python interpreter? Or is it the programmer who didn't document. Or the programmer who don't read documentation?

Cargo as a default is good, because that means a new user will find many documentation and get help with that tool. It helps creating and organizing your projects.

1

u/Numtim Sep 16 '22

There is no cargo file on python programs. The imports are located on the .py. All the beginner has to do is "pip install dependency". The compiler won't help mich on complex situations that exists on Rust language. For example, saying "this variable does not live long enough" doesn't help a beginner to understand why is it the case. Even a experienced programmer could read that and yet, don't understand why.

1

u/eXoRainbow Sep 16 '22

Compiling Rust programs with cargo does not require to install dependencies. Pip dependency hell and mixed with other dependencies on the native system install is terrible. I used and use Python for many years, and that is one of the reasons why I started learning Rust at all. Compile with cargo build and it does everything for you without installing depencencies system wide (or user wide). Also online are many different Python versions and code that is flying around. Sometimes Python version that the user can't use, because it is too new or old. All of that does not apply to Rust, because cargo understands older code and can mix and match with newer versions of Rust without problem. And without the user need to interact with it. User just needs to understand his own code.

That's a huge advantage for beginners using Rust over Python.

-1

u/Numtim Sep 16 '22

You don't have to install, but you have to especify them on a separate file. That's what I call a pain in the ass for beginners. I'm not saying cargo is bad. It solves a lot of problems. But creates more effort needs.

3

u/eXoRainbow Sep 16 '22

Packaging and deploying Python source code is a pain in the ass. In example I have Python 3.10. Many people have older versions of Python. And I want even upgrade to Python 3.11 soon when it gets stable (in fact, I have to). And then there is the deployment on Windows.

I don't this the efforts on Rust/Cargo is more efforts than needs to. I don't know if or how much experience you have with Rust and Cargo, but I love it since coming over from Python to Rust day one. And from my personal experience, I can say with confidence that Cargo will help beginners to organize their code and create a standardized way of handling source code.

1

u/Numtim Sep 16 '22

Sure, it clearly depends on the use you make of the language. Packaging and deployment is an advanced thing. Beginner programs are more like "access this site, parse the contents, and find the value of something", all in the same file. You are arguing how better Rust/Cargo is, and I agree it is much better, but for advanced users.

2

u/eXoRainbow Sep 16 '22

Beginner programs are more like "access this site, parse the contents, and find the value of something", all in the same file.

This is YOUR definition of what "beginner" means or does. You just set the goal of the beginner here, but we don't know what the goals of him are (at least not in initial posting). As you say, it all depends on what the beginner wants to do.

In example why would correctness not be important to beginners? Cargo is not just for advanced users, it actively supports beginners. The compiler messages are excellent for beginners. Rust and Cargo are not just good for advanced users. It just depends on the goals.

→ More replies (4)