Settings

Theme

Ask HN: Should I learn C or C++?

1 points by init-as 7 years ago · 12 comments · 1 min read


I am going to college in the US in September as an international student but my school year finished in January. I have about 8 more months of doing nothing on my hands and had thought about learning C or C++ just because I have always heard that they give you a good base knowledge of how other languages work under the hood. I would say I'm fluent in Java, Swift and Python.

Do you have any recommendations for which one I should tackle (or neither)? If you had a good resource to help me learn as someone who isn't a beginner, that would also be great too. Thanks.

rzzzwilson 7 years ago

I'd say start with C because it is closer to the hardware and it's simpler to learn than C++. You will find it easier to pick up C++ later if that is required.

If you know a few other languages it shouldn't take 8 months to become at least proficient at C, so you might then try another language that really stretches your brain. Something like Haskell or even a Lisp. After a language that gets closer to the hardware like C try something very abstract and high level. That's why I mention Lisp above. Reading SICP [0] made me realise just how much of a logical system you can synthesize from almost nothing.

[0] Structure and Interpretation of Computer Programs https://en.wikipedia.org/wiki/Structure_and_Interpretation_o...

arcticwombat 7 years ago

I suggest looking into the curriculum of your upcoming studies and getting a headstart with whatever language(s) you'll be studying.

The simple truth is that unless you truly specialize, your software developer career is going to be a long string of learning things to solve a problem.

Look up the language you'll be studying, pick one that sounds neat, and grab the nearest tutorial that includes the words "For beginners" in the title.

smt88 7 years ago

It sounds like you’re way ahead of most of your peers when it comes to technical skills. Why not spend the time developing/practicing social skills or on another hobby altogether?

People burn out on coding faster than they think, and you have a lifetime to do it in your career. You’ll probably never get 8 months of free time again, though.

jki275 7 years ago

Learn both. C will make you a better programmer, and C++ will set you up for success in the world.

  • smt88 7 years ago

    What do you mean when you say C++ would set them up for success?

    • jki275 7 years ago

      Lots of jobs for C++ programmers. It's still industry standard in many industries.

  • init-asOP 7 years ago

    Fair, which one would you recommend picking up first?

    • cimmanom 7 years ago

      C first. C++ was originally a superset of C, though my understanding is that that is no longer strictly the case.

      Still, learning C will make it easier to learn C++, because C is far simpler and in order to understand C++ you’ll have to master C’s concepts anyway.

      • kazinator 7 years ago

        C++ still the superset of a language that is a dialect of C. In terms of ISO, it's probably still closest to the C90 dialect, with some C99-like features (inline functions, // comments).

    • icedchai 7 years ago

      Nearly everything you learn with C can be applied to C++ (though some may be frowned upon in modern code bases.) So I recommend learning C...

    • jki275 7 years ago

      I would agree -- C first. C is foundational knowledge imo.

kazinator 7 years ago

If you don't know C, you can hardly write a C++ main function that processes the arguments. Or use C libraries effectively (without someone who does know the C-like subset of C++ having written a class framework for you which wraps them).

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection