
Learn C or Rust first? - Pharohbot
I&#x27;m 15, I know JavaScript and taking AP Java in school(I really don&#x27;t like it), and I&#x27;m very intrigued by Rust. Should I learn C first though? I don&#x27;t really want to but some people said I should but some others said it doesn&#x27;t matter, since you can learn a lot a bit less of what C teaches you(since some Rust libraries hide some complexity, is it really important though?), but its still a lot of information about how memory&#x2F;computers work, however, I&#x27;m more interested in the language than how the computer&#x27;s internal systems work right now.
======
angersock
Learn C first. Learn C first. _Learn C first_.

It's a small language, it's everywhere, and it's going to build character.

Rust is still undergoing active development, and solves a different problem
space than C by virtue of what it adds. It's a good language, mind you, but it
doesn't expose you to the warts of hardware like C will (by design!). It won't
let you deal with null or dangling pointers. It will abstract away data types
with _let_. It will treat memory safely (which it really isn't). It's a great
language that will hopefully replace C one day, but that doesn't mean you
should start there.

Learning and debugging C will help you understand how processors work
(especially if you start with something simple like an MSP430 devkit). You can
look at the code and the generated assembly and see pretty much how the
compiler came up with what it did. If you're developing on a Unix descendant,
you'll be dealing with things at a level the operating system intends.

You'll get to look at a huge corpus of code already out there and see what
works and what doesn't, and if it strikes you you'll be able to modify it
(say, making mods for Half-Life or Quake 3 or whatever) and see how things
work.

Start with C!

EDIT:

Later, you'll see _why_ C needed replacing. You'll never appreciate Java
fully, for example, without dealing with all the stupid C++ allows.

Comedy option--learn Erlang or Elixir--you'll be spoiled for the rest of your
career once you see how annoying things can be elsewhere.

~~~
Pharohbot
but I stated that I do not wish to learn about how the internals of the
computer works, rather than im more interested in the language itself, which
is Rust. plus I saw Elixir, I didnt like it all :(

~~~
angersock
So, no language worth it's salt completely hides how the computer works from
you (again, except for certain members of the FP family, or declarative
languages like Prolog or SQL).

For example, Javascript has a problems when adding ".1+.2". Know why? IEEE754
limitations on double-precision floating-point arithmetic, as implemented in
hardware.

 _Programming languages exist to program the machine_ , full stop. Everything
else is just people faffing about on their thesis defense.

Anyways, if you didn't like Elixir--probably because you don't have the
experience yet to see why it's awesome--that's okay: learn C. :)

~~~
Pharohbot
I really meant that I prefer JS(Node/IO) over Elixir.

------
markuz
I never wanted to learn the details of how a computer really work as, but I
spend a single week learning C, just to learn the basic concepts like
pointers. It really helped me understand better other languages. Besides, It
would take you many years for you to master it, and the kind of jobs you would
get with it would f* damn boring. Don't waste more than a week on it :)

I'm learning Rust at the moment, I feel I can express my ideas better with it
versus go. But as a hobby. for fun.

I've being coding exclusively in JS for 3 years. And just now I feel
comfortable with it.

There is so much going on with it. I bet you heard about OOP, but what about
functional programing. And functional reactive programing ?

There are so many libraries and framework in JS. It just crazy. There is
angular vs ember. And what about react or famo.us ? And there is nodejs, and
things like npm, gulp, browserify.

To learn javascript, the language is one thing. But all its tools is another.

The reality is this, the more languages you learn, the easier it is to learn a
next one. Today I know over 10 languages, but I master only one. And that is
what matters, the one you master.

But what I things is super important for a programmer this days is a basic
knowledge of shell and git. IMO

------
smt88
I'd suggest Go over Rust for a beginner. Go would allow you to do pretty much
any kind of project you wanted (web API, mobile app, CLI tool), which is
what's important for learning: having little hobby projects that you do on
your own.

By learning Java, you're already getting some good CS fundamentals. It
probably wouldn't help you that much to learn C on top of that.

I'll leave you with this: if you want to make programming into a career, you
don't need to learn C. If you want to study programming as a researcher or
teach it, you should learn C.

Being 15, you don't know what you want to do though, so I'd suggest just doing
what you find fun for now and worry about the rest of it later.

~~~
angersock
This is really bad advice, except for the last part. :)

If the idea is "Hey, let's use a framework good for beginners and hack
together projects", OP should just extend their Javascript knowledge into
Nodejs--and there's nothing wrong with that.

 _" By learning Java, you're already getting some good CS fundamentals."_

This is wrong. If you are trying to learn CS fundamentals, learn Scheme or
Clojure or some other functional language. Java in practice is basically
plumbing together large frameworks built by people smarter than you who
probably worked at Sun fifteen years ago--and who often got things wrong. Java
in theory is ramming OOP design down your throat, and still exposing enough
implementation details of the runtime that you can't ignore them.

Java is a _not_ a good way to learn CS fundamentals.

 _if you want to make programming into a career, you don 't need to learn C._

This is only true if you want to be a blub programmer and punch the clock and
basically just farm code in enterprise. Learning C is essential (barring
learning assembly) to getting access to great swathes of performance-critical
environments, tracking down weird bugs, and generally understanding what you
machine is doing.

~~~
smt88
_This is only true if you want to be a blub programmer and punch the clock and
basically just farm code in enterprise._

Times change. A lot of (what I would consider) interesting jobs only require
web languages, which are high-level, messy, and abstract away a huge amount of
underlying complexity (many would say too much).

I'm telling him/her how things are, not how we want them to be. Only a small
fraction of being can be great engineers. The rest of the millions of
developers out there are writing sloppy blub code on top of an opinionated
framework.

 _If you are trying to learn CS fundamentals, learn Scheme or Clojure or some
other functional language._

I don't think we're using the same definition of "fundamentals". I was talking
about things as simple as writing code, compiling, debugging, and googling
(the most important skill of a programmer).

S/he'd also be learning OOP, which dwarfs FP in the web development world[1].
I actually don't think I've ever heard of a popular web framework that was
written functionally, though I should also mention that I think the practical
differences between FP and well-written OO are exaggerated. They aren't
mutually exclusive, and OO doesn't imply mutability.

1\. [http://lifehacker.com/the-top-programming-languages-
ranked-b...](http://lifehacker.com/the-top-programming-languages-ranked-by-
job-demand-po-1601752302)

------
ripitrust
Maybe you could briefly go through K&R, it is both readable and challenging.
Then start Rust

~~~
jerven
I strongly disagree, when I was 15 I got the same advice and it nearly turned
me away from programming. K&R is not a good standalone text book. (Sure I had
no internet and just a redhat5 clone, but K&R just was not that helpful)

I would pick Rust to learn over C when starting today. Rust matches today's
machine beter. It is a more organized language and eco system. And most of all
learning to code corect is easier when you do not run into undefined behaviour
right and left.

So a modern language like Rust will expose more concepts to you and picking up
C is easier afterwards, although you might not want to.

