3 ms·
> If programmers will learn Rust as first language Imagine a person who just started learning about programming. A person who may still be tripped up by the fa
by usrbinbash 3y ago
> If programmers will learn Rust as first language
Imagine a person who just started learning about programming. A person who may still be tripped up by the fact that `=` and `==` are completely different things here.
Imagine that person.
And now imagine explaining to that person a language, that even many experienced and skilled software developers say is significantly harder to learn than the average programming language.
Sorry, but when I think about a good teaching language, Rust isn't the first thing that comes to my mind.
- baq 3y agoAnd neither is C/C++, in which you have to follow all the borrowing rules except the compiler maybe sometimes warns you about something instead of always erroring out. Python, go or (a bit less so) typescript are nice beginner languages.
- usrbinbash 3y agoC++ isn't, but C was my first programming language, and I am thankful for this to this day. Because C in and of itself, is an incredibly simple language. It is made complex in libs, usually by abusing macros, or by trying to shoehorn it into OOP, FP, or whatever other paradigm is currently being idolized. > Python, go Go yes, Python no, and I am saying that as someone who does alot of work in Python and loves both languages. Because Python isn't simple. It looks simple in trivial code, but hides an enormeous amount of complexity and magic not-so-far beneath the surface. In addition, it completely fails at teaching core concepts of memory, and dances around the topic of types.
- baq 3y agoBut C is anything but simple! It's small but it's so full of undefined behaviors it requires considerable knowledge and experience to stay within the bounds of 'predictable'. It's better nowadays if you are taught to enable all possible warnings and even then you'd better use a static analyzer and valgrind for anything more than hello world. Python's hiding of memory is a feature when teaching beginners programming IMHO unless you want to start teaching close to the metal. I prefer to start from the algorithmic CS-y side.
- usrbinbash 3y ago> it requires considerable knowledge and experience to stay within the bounds of 'predictable' No it really doesn't. Initialize all variables, always check boundaries and free memory when you're done with it. That about covers 90% of it. Yes, this becomes more difficult the less trivial the codebase becomes. But beginners don't have non-trivial codebases, and teaching these concepts isn't hard. > Python's hiding of memory is a feature when teaching beginners programming IMHO unless you want to start teaching close to the metal. I prefer to start from the algorithmic CS-y side. And I prefer to start from the systems-programming, practical side. And in the practical world, memory isn't some abstract thing that may or may not exist, function calls cause overhead, strict typing is a friend, and networks fail. So yes, teaching a bit closer to the metal has its advantages.
- oneshtein 3y agoPascal, C, Java are used as first languages successfully. Why Rust cannot? It's even easier to use than C and Pascal. Rust is hard for older programmers because it's hard to FORGET old habits from other languages, which allowed too much.
- usrbinbash 3y ago> It's even easier to use than C No, it isn't, by any metric. I personally know people who learned C in a week. I learned all basics of the language in 2 weeks as a teenager, with nothing but K&R as learning materials. If you disagree, point out by which metrics you consider Rust to be easier to learn than C, and we can have a discussion. > Rust is hard for older programmers because it's hard to FORGET old habits from other languages, which allowed too much. No it isn't. First, both newcomers and experienced programmers consider Rust a more complicated language than most of its contemporaries, and if anything a solif experience in multiple programming languages makes it easier to learn the advanced concepts Rust relies on.
- oneshtein 3y agoRust can be used as C, because it has pointers, like C. However, Rust has better syntax, more syntax sugar, automatic memory management, automatic memory manager and borrow checker. So, Rust is simpler than C to learn.
- usrbinbash 3y ago> However, Rust has better syntax Better by what metric? > more syntax sugar More features and syntactic concepts don't make a language easier to learn.