Hacker News new | past | comments | ask | show | jobs | submit login

I really think rust is great, but after learning what memory management is.

Teaching rust first would just be a weird memorization of rules that you might not appreciate.




The borrow checking rules of Rust are anything but "weird". They boil down to not mixing up shared references and exclusive borrows; and, more subtly, preserving the distinction between temporary borrows and complete ownership. (I.e. only the owner can dispose an object; when borrowing, you can only give it back.) That's quite teachable, albeit using these rules in practice is not nearly as easy.


I agree, if C++ can be taught then so can Rust.

But pedagogically, it is difficult to motivate why we can’t read a reference and mutate it in the same scope, since Python, JavaScript, Ruby, Lua, Lisp, Java, OCaml, C, etc. all allow it. It is much easier to accept this hurdle after having seen and debugged memory bugs and data races in, e.g., C.


I’m sure it could be, and maybe I am wrong but I know people say rust has a rough learning curve.

I learned C and Typescript before ever touching rust, and I feel like I experienced no rough introduction. Maybe it’s anecdotal, but I always assumed I learned memory and semi-functional programming first, which made rust a breeze.


> Teaching rust first would just be a weird memorization of rules that you might not appreciate.

That's pretty much exactly the situation with first-time programmers who are taught Java—none of the background to know why it makes the decisions it does.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: