It's doing a great job of teaching me C, while also reminding me how great high level languages actually are!
Ask HN: How do I learn C and C++ when I love high-level languages?
11–20 of 62 posts
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#12Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#13Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#14Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#15You really want to work with people who have done C++ before, because there are a number of tricks (RAII, ownership conventions, using const references and references to signal ownership conventions, smart pointers, unique_ptr, etc.) that are common industry practice but aren't all that well-documented on the web. C++ differs from Java or Python in that often the hard part isn't figuring out how to do something, but figuring out what not to do.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#16Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#17This is only half of it. The second half is to choose a mid size project, write yourself something that resembles a spec, and code it up from scratch. It could be some sys util or perhaps a video game (this will require you to learn library linking).
The third half is to read online articles and tutorials while you do the two things above.
The fourth and final half is to get yourself a book once you have a grasp on the language(s) and learn some of their more complicated idioms and pitfalls.
Also as a side note, at this point in time I don't think the "C/C++" conglomerate make much sense any more as modern C++ looks very different from C. Unless you explicitly need C, I would suggest learning C++ first as it's higher level (and also much larger). Though, idk, maybe learning C first is better as it's the foundation for C++... I guess either is fine, just not both simultaneously.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#18Pick something fun to write (to you) that is normally written in a lower level language.
For me C and C++ were fun to learn by writing graphics applications (ray tracers are great for this) and physics simulations (a solar system simulation maybe). Optimizing these to be as fast as possible is a great way to learn about pointers and manual memory management.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#19Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#20Having said that, C++ has come a long way, despite what haters say. I program primarily in C++ and very rarely have to use pointers. C++11/14 has excellent features (lambdas, initialization lists etc) which can make programming almost seem like writing a Python or Ruby script.
You may also have some luck with Bjarne's smallish "Tour of C++" book -- http://www.stroustrup.com/Tour.html