Hacker News new | ask | show | jobs
by harikb 2164 days ago
Is this undergrad? Genuinely curious, how will you get someone to understand what ownership helps avoid without them having experienced the pain on the other side?

I guess with younger and younger kids learning programming these, may be there can handle more? I am not sure if my son would understand all of the intricacies in his first semester.

4 comments

University of Maryland teaches Rust for a single lecture as a part of their CMSC330 (Organization of Programming Languages) [1] undergraduate class. The lecture slides are available online [2].

[1] https://www.cs.umd.edu/class/spring2020/cmsc330/

[2] https://www.cs.umd.edu/class/spring2020/cmsc330/lectures/25-...

One section of CS3210 Design of Operating Systems at Georgia Tech in the Spring was experimentally using Rust[0]. I'd never used it before, but by that point I had a decent amount of experience with C from previous classes. I personally didn't struggle with the borrow checker too much, because I did have some experience with what happens when there isn't ownership. I took another C and C++ heavy course at the same time (CS4290) and wished I could use Rust, since most of my trouble with projects came down to debugging pointers not being in the right place. I'm in the Systems concentration though, so I don't know how people only experienced in, for lack of a better term, higher-level languages would fare. Still, I think that students interested in taking a Rust class would have enough experience with other systems languages to be able to see what ownership can do for you.

Maybe the professor for this class could assign a non-trivial project in C at the start of the semester then the same project again at the end of the semester except in Rust.

[0] https://tc.gts3.org/cs3210/2020/spring/

Yes it is a course aimed at undergrad students, in their second year at university.

Of course they won't be able to grasp everything that Rust has to offer, but that is true of any language. I think Rust will expose them to many theoretical and practical CS concepts that they will be glad to have at least heard of during their studies.

In our degree, the first year students learn to program with Python, Racket (or OCaml depending on which teacher they get), C, Prolog, Bash, … Each of these language have way more to offer than what they can grasp. But each of them offers a different approach to programming and help the students to actually learn to program (rather than learning to write Java code, for example).

The course in question is actually called "Advanced programming". I want to experiment with a Rust course in second year as a kind of followup to both the functional programming course (the Racket/OCaml one) and the imperative programming course (the C one) that they have during the first year. If it really doesn't work, we'll change for something else or simply swap back to it being "Advanced C programming" for instance. But first, let's try to make the Rust experiment work. I really think it can benefits our students!

sorry, when you said first semester, I assumed you meant first semester of the 4 yr course, as in intro classes. But you probably meant first semester of this year. Either way, it is good to experiment. Thank you for doing that.
> Genuinely curious, how will you get someone to understand what ownership helps avoid without them having experienced the pain on the other side?

This is an eternal debate about Rust. I don't think it's required though. Can you appreciate functions without understanding assembly and calling conventions? I believe the answer is yes :)

I actually find that people who aren't that familiar with programming are pretty quick to accept the idea that aliasing xor mutable is an okay rule... not because it's been exhaustively explained, but just because people have no real expectations at all about how things should work when they're starting out. A lot of language rules seem arbitrary at that point. Afterwards, when using other languages, they may even find it surprising that you can mutate stuff without this rule... it's all about what you're used to.
From someone who is self taught and learned C as a second language, is teaching rust at this stage a great idea? there is a lot of news about rust lately and it very much seems like people are seeing rust as a hammer and the world as nails.
I don't know. To be honest, having taught a lot of programming stuff, I don't think there is any one best approach to learning programming, and it's very hard to figure out what will be easy or hard for someone just learning. People also learn languages for different reasons--for many people, for example, the main reason they're learning is to get a job in the industry, and if that's the case learning Rust is not really a good idea regardless of any of that stuff, since there aren't that many Rust jobs compared to, say, Python or JavaScript jobs.