3 ms·
>recommend beginners to learn rust before C This is one thing I've been musing over. Would a beginner see the benefits of rust without first understanding the
by timlyo 10y ago
>recommend beginners to learn rust before C
This is one thing I've been musing over. Would a beginner see the benefits of rust without first understanding the drawbacks of C?
In my opinion they'd just see it as "this annoying borrow checker thing" and find it frustrating.
- gcp 10y agoI'm not sure. If you're taught that's how languages work, maybe it feels normal. The first language you learn influences a lot of your thinking. I started with QBASIC :-(
- pjmlp 10y agoQBasic was quite good, we had ZX Spectrum and Timex BASIC....
- sametmax 10y agoNo they wouldn't. But most people learning C didn't get the benefit over Assembly. Java over C. Python over Java. Unless you learn everything, you can't know. But we are passed this stage of the computing era where we can master everything. You have now excellent bankers, geographers, designers, sysadmin that need programming and will just need to learn Python and nothing else. And what about the coders of custom OS for very low powered embeded board ? They can't learn NodeJS + Webpack. They don't have time for that. You don't have a lot of concurrency ? Don't learn Go or Erlang. You need a few automation. SQL is not for you. It's VERY GOOD to go outside of bubble and learn new things. If you have time, learn some functional languages, read about how to build your own interpreter, have fun with the amazing possibilities of deep learning. But you don't have infinite time, you must make a choice. And I believe strongly Rust is a good replacement for C/C++ and will be in the future. Should we stop learning C ? Well you'll need C dev for the next 30 years so as a market skill, it's worth it. But in 5 years, you will be able to get away with just Rust skills. And you may be happier.
- absove 10y agoIn my opinion good practices being enforced by the language/compiler is even more beneficial for beginners than it is for experienced programmers, especially because in C it's up to the student to figure these out by himself. Or with the teaching material, but if we can offload that to the compiler, why not?
- pjmlp 10y ago> Would a beginner see the benefits of rust without first understanding the drawbacks of C? Better, it would make him aware of C's shortcomings when the time comes to learn C, instead of getting the wrong idea C is the only path to systems programming. I learned systems programming back in the 80's via Assembly, Turbo Basic, quickly followed by Turbo Pascal. When the time came to learn C, I was already on Turbo Pascal 6.0, and the frustrating part was being aware that there was already a better way of talking to the machine. Also another point, was that C pointers were never confusing to me, because I learned the best practices in those languages.
- cd_cd 10y agopj I always detect a degree of "disdain" for C in your comments. Back in the 80s everything was system programming if you wanted performant software. C replaced Pascal during the 80s because it was a better language - simple as. Today I code almost entirely in C and rarely need to use Assembly. C started to be used beyond Unix during the 80s (AmigaOS was written in C except for third party IO library written in BCPL) because it is a small and very concise language; Pascal had just too much abstraction - for example how it dealt with bitwise operations. This meant C compilers could do better jobs in terms of optimisation. This is reflected in C replacing Pascal in PC game programming in the late 1980s and early 1990s. Also a lot of Amiga games were also written in C (Cinemaware games) and Megadrive games too (Sonic Spinball, Ecco etc.). In short C is just the best HLL out there when it comes to programming systems with meager resources. As for Rust - like Go - its supporters will eventually throw in the towel. C is king of system programming.