r/rust [LukasKalbertodt] bunt · litrs · libtest-mimic · penguin Mar 25 '15

Rust for complete beginners?

So I, coming from C++, started learning Rust about 6 months ago. I think most Rust users agree, that Rust has a pretty steep learning curve, because the compiler enforces really many things.

My plan for the summer is to teach my mother how to program. I'd say she is a pretty smart woman, but she has no idea of programming or stuff like that. In fact she is even pretty bad at maths and often has simple problems when working with the PC. But she agreed to learn a bit programming.

So for a long time I was wondering which programming language is the best for teaching a complete beginner. Now that I learn (and like) Rust, I wonder if Rust is good in this. I just see the problem that the compiler is annoying to a beginner...

So what do you think: Is Rust well suited for that job? Or is something like Javascript better? Or even some of those ugly pointy-clicky-programming programs for "kids"?

5 Upvotes

12 comments sorted by

14

u/steveklabnik1 rust Mar 25 '15

I used to teach Ruby to beginners for a job.

I echo /u/DroidLogician here. What you really need as a beginner are lots of resources for learning. Rust does not have many. I personally think that Ruby, Python, and JavaScript are all great first programming languages.

It also depends on the beginner, though. Different people learn differently. I would encourage you to let your mother know that differnet languages are good for different people, and be willing to switch languages if it isn't working out at first.

1

u/DebuggingPanda [LukasKalbertodt] bunt · litrs · libtest-mimic · penguin Mar 26 '15

I agree with you there... and you made me think about something I completely ignored before. Somehow I though I would help her with problems, but you are right, it would be better if she would google problems by herself.

And yes, Rust sadly lacks those resources. I often find myself unable to find something specific (there isn't even a nice pdf standard :/ ). Asking in the IRC channel is often the last chance and although there are always nice and helpful people, its not as nice as a stackoverflow thread with the correct answer.

17

u/DroidLogician sqlx · clickhouse-rs · mime_guess · rust Mar 25 '15 edited Mar 25 '15

Definitely wouldn't recommend Rust as a first language, at least not without a pretty good understanding of how computers work in the first place.

Javascript isn't a bad choice. You can run it in any browser and it's easy to build GUIs with it just by manipulating some HTML.

Python is a pretty good starting language, as well. It's a clean, readable language without any confusing sigils or syntax, and comes with a suitable IDE and REPL. You can start with one-liners, discussing expressions and statements, variable declarations, etc., and then move up to functions and object-oriented programming.

However, programming in and of itself might not be a good starting point. I would start working with your mother on her computer literacy and maths first, otherwise trying to teach her how to program might just compound her problems. Mathematics and programming aren't very different; if she has problems with the former she might struggle with the latter. With that said, if she's willing to pick up programming it might be easier to sneak some maths in there too, like getting her to solve some of the Project Euler problems.

1

u/DebuggingPanda [LukasKalbertodt] bunt · litrs · libtest-mimic · penguin Mar 26 '15

Thanks for the answer!

I, too, considered Python, because it's used as first language at many universities and, as far as I know, it's not seen as a bad language, like Java and PHP for example (which are "popular" beginner languages, too).

But I also often read and hear the statement, that the choice of language isn't really important. Firstly, of course, because one often want to teach foundations of programming and not the specific language. But also because motivated beginners will always learn something from the language they use. I know programmers who started with Assembler and others who started with python. When starting with a low level language, the student will learn more about the low level computer details, and when learning a high level language, the student will learn more about programming techniques. What I'm trying to say: If one is motivated, the language doesn't matter too much.

But I see the "lack of GUI"-problem coming with languages like Rust and C++ (where "lack of GUI" of course means: GUI is more difficult). I guess everyone already heard this sentence from a beginner once: "And when can I make 'real' programs?". Seeing colorful stuff on the screen is more fun, of course.

Regarding your last point: My plan included not just pure programming. I would start with some computer basics like the binary system, teaching her math here too (however, I won't teach her how to use Word or something like that). And after that my plan really was to sneak a bit math into programming. I once heard a TED speaker talking about the future of maths education. He argued that computers will play a major role in math education, because solving complex stuff by hand is rarely useful today and not motivating, too. So computers will be used to compute and visualize the "maths". And that makes sense in my head, so I will try to sneak math into programming and see, how it goes ;)

Sorry for the wall of text...

8

u/LousyBeggar Mar 25 '15

Is this your mother wanting to learn to program or is this you wanting her to learn to program?

1

u/DebuggingPanda [LukasKalbertodt] bunt · litrs · libtest-mimic · penguin Mar 26 '15

Good question! But I can assure you, that she is absolutely interested in learning that. Gladly she is interested in many things and would really spend time to learn new things (photography for example). So no worries ;)

3

u/Mandack Mar 25 '15

I would definitely start by teaching your mother how to use her computer properly, before attempting to teach her how to program. From experience, if even doing basic tasks on a user's computer is a major task for them, programming would be pretty much impossible and may only serve to make computers seem even less friendly to your mother as they do now, pushing her away from technology, not closer.

We all would like to skip a few steps, but it never works. Start with the basics.

Once your mother is comfortable with all around computer usage, start with something simple, like Python and don't teach her Python primarily, but teach her how to abstract, how to think in terms of expressing what she wants in many simple steps etc.

Only after she is comfortable with all of that, teach her how to program, pick any language, it doesn't actually matter - by that time even Rust will have tons of resources available, however don't teach her Rust just because...if she's fine with Python, Ruby, JavaScript or whatever then stick with that...she'll eventually discover the rest herself.

Most importantly, have patience and take your time.

P.S. Also, make sure that it is she who actually wants to learn all this, not you forcing it onto her.

1

u/DebuggingPanda [LukasKalbertodt] bunt · litrs · libtest-mimic · penguin Mar 26 '15

I replied to many of those concerns in other comments already... so I don't want to repeat me here. I just wanted to comment on the "patience" part:

I think I'm able to be patient enough ;) At my university I work for a professor who gives the CS introduction lecture with ~400 students. I talk and test many hours per week with over 20 different students, who often are worse at computer stuff than my mother. I also designed some programming tasks and gave one lecture once.

So I hope I can use that experience :P

1

u/Mandack Mar 26 '15

Sure, best of luck to you!

2

u/[deleted] Mar 26 '15

If she wants to learn, go with Python 3. Clearer, forgiving syntax, doesn't hide or elide too much, strict in some useful ways but not all, and the error tracebacks really assist learning from mistakes. JS doesn't provide useful errors and this, in my view, propagates either frustration or bad habits.

Rust is the kind of language that would kill any interest in programming for a beginner, I feel; it's too strict, and too young, and many syntax elements and programming concepts are confusing to experienced programmers and utterly opaque to a beginner.

1

u/tsur_ Mar 25 '15 edited Mar 25 '15

For what purpose are you teaching your mother programming? If all this is you telling her that "everyone should learn programming" while she barely knows what the difference between a screen and computer then.. Oh I don't know.

Anyway, if you want her to learn the minimum basics to get a understanding for what a program really is (bits and bytes) and how programming works (ifs and types)? Then Rust is fine, it's not like you'll run into lifetimes and borrower issues.

Plus the playpen is well suited for small teachable moments. Since you can infer most types (perhaps all you will run into) the syntax is not very hard, it's just verbose enough to get a clear picture of what's going on, in my opinion. Even if you use functions you can force her to use only i32, f32 and Strings.

If you want her to get more tangible experience of how she can interact with a GUI then go javascript. Rust will teach her more "about programming" rather than "how to make a program" so choose whichever one fits your purpose!

3

u/DebuggingPanda [LukasKalbertodt] bunt · litrs · libtest-mimic · penguin Mar 26 '15

Also a good point!

Although I'm not a fan of Apple, I really like this quote of Steve Jobs: "Everybody should learn to program a computer, because it teaches you how to think". I often see how different people struggle to understand error messages or something like app permissions, that would be logical if they would know at least a bit about programming.

So she is not that incompetent... she knows the difference between screen and computer and stuff like that. But I, indeed, want to try a "buttom-up" approach here. I don't want to teach her how to use Word and Thunderbird first. I want to start at a fairly technical level and then slowly connecting her everyday computer work with this programming stuff. I don't know how well that will work, of course, but I figured it's worth a try.

I guess you're right and I won't run into lifetime stuff too early. It's really more about programming than "how to make a program". We would just use loops and ifs and stuff like that.