Is it a good idea to learn Rust as a first language?

I can appreciate that idea.

On the other hand, my first experience of a "run time" was a teletype connected via acoustically coupled modem to some mainframe far away. We saved our work on paper tape.

We had to edit our code by entering the line number of the line we wanted to change and retyping it. Line by line.

It's not clear to me that all of that was any simpler than editing some code in a nice editor and typing "cargo run" today.

1 Like

I heartily agree with the "tears and times of desperation" comment. I've written non-trivial programs in 16 languages. Every time I start learning a new language there is a period ranging from a week to a month where I feel like I'll never get it. I persist, and things eventually click.

It's a personality thing. My son simply wasn't able to push through that frustration. Of course, his first exposure to programming was C++, so that might have something to do with it.

2 Likes

Now that is just cruel and unusual punishment.

:slight_smile:

2 Likes

He was a math major. The first day of class he called me and said, "Dad, x = x +1. What's up with that?"

7 Likes

I just wanted to mention one more advantage of Python as a first language which I still did not see anyone mention: one can work on Python on interactive mode.
That is pretty good when first learning immediately sit and try out how things work.

the notion that those new to programming should learn with some other "lesser" language

When I recommended Python as a first language I did not consider it a "lesser" language than Rust. I really do not.

It all depends on how one looks at it and what ones values are. Which is why I put "lesser" in quotes.

Theoretically I guess we should not make such a comparison. All language are of equivalent power. Because Turing.

From a practical point of view one can make lesser/greater comparisons. One could say Python is lesser because:

  • Lesser performance.
  • Lesser scalability across multi-core systems.
  • Lesser ability to interface to hardware (None without libs written in other languages).
  • Lesser emphasis on correctness with it's type system and white space block delimiting.
  • Lesser ability to run on tiny micro-controllers (I know, Micro Python)

Of course if one is not obsessed with the above, less can be more, Python has less syntactic junk and complication to deal with. Which might be just the thing for those new to programming.

I agree in all points but one: From a beginner's perspective Python wins in "interface to hardware" as it is the lingua franca on Raspberry Pies. Yes, you need libs written in other languages but they are there and they come with the operating system..

One could equally say Rust is "lesser" because

  • less chance of finding a real life friend whom you can ask
  • less books you can read, especially if your first language is not English, chances of a first and a second and a third book in your first languages are good for Python.
  • less programmer's support by a garbage collector
  • less "stood the test of time"
  • less mature data science crates/modules
  • less legacy code to be maintained, if we want job offers to count in the question of first languages (I tend to not count that one, myself)
  • needs new compilation when a programm written on Windows is supposed to run on Mac
  • couldn't find a HowTo on writing GIMP plugins - compare that to Python!
  • can you even script Blender in Rust?
  • googling constantly leads to some online computer game where googling Python rarely leads to snakes or British comedy groups.
  • REPL, REPL and REPL

You are perfectly right: It all depends on how one looks at it and I would not be here rather than in a Python forum if I did not get your points of the superiority of Rust in some respects!

Exactly.

To be fair though, most of the items on your list are not about the language per se, but rather about the ecosystem/environment/community around it.

Not say that all of that isn't important. It's is and a very significant part of making a language selection. After all if Rust was still only Graydon Hoare's hobby project and nobody else ever adopted it, would I be here? Unlikely, no matter how good it was.

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.