Edit: I'm sorry if this sounds condescending, but I really mean it. Basic is about one step above assembler - you get variables and nice access to some basic IO, but it's much closer to the metal than C. It really doesn't even have functions, you have to do GOSUB/RET yourself. It's also an extremely simple language. But it will give you an idea on how computers work at a basic level. After that you should have a much easier time grokking C.
Ask HN: How do I learn C and C++ when I love high-level languages?
31–40 of 62 posts
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#32Go to a code practice site like hackerrank or oj.leetcode (personal favorite but I suggest using an external compiler for it) and solve problems. Start from the simplest ones and make your way up. Once you solve a problem, go back the following day or week and without using a reference solve it from scratch. After solving a problem look at the solutions provided in the forums. A lot of the time they will be a lot mor…
four halves, huh?
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#33IMO you don't need to know either C or asm to be a great programmer. Read a book on operating systems instead and you'll know all you need to about hardware. Add a thorough coverage of algorithms and data structures, and you're in a better position to write effective software than many I've worked with.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#34Do you really need to learn a another language, when you don't like its features? All general-purpose programming languages can solve the same problem.
"All general-purpose programming languages can solve the same problem." That's not really true, in general. They can all compute the same things. Some problems have constraints beyond "what is computed".
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#35Have you tried Go? Might make the transition a little easier. UDP hole punching is always fun with C/C++.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#36Get yourself an Arduino or some other similar cheap hardware dev kit and build some project for fun? It's a start.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#37Also read some reviews of the book before you spend any time reading it. The mid 90's were a really bad time for C++ in my opinion since it was kind of a new language and being pushed heavily as the default 'learn computer programming' language (which Java later usurped). This means there are tons of very badly written and confusing resources that do more harm trying to teach C++ than actual good. Stuff like Deitel's C++ How To Program, etc.
For C++ in particular I can recommend:
Thinking in C++ (http://mindview.net/Books/TICPP/ThinkingInCPP2e.html) Although it's getting a little old, I think this is a great resource for someone just picking up the language.
A Tour of C++ (http://www.stroustrup.com/Tour.html) Great small intro to modern C++ programming, by the creator of the language.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#38Why do you want to learn C or C++ if you can't think of something you'd like to use them for? I've written a fair bit of assembler and occasionally still do tiny projects in C or C++, but my language of choice (by far) is the highest level general purpose one I've come across. IMO you don't need to know either C or asm to be a great programmer. Read a book on operating systems instead and you'll know all you need to…
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#39Let me address the motivation issue.
C/C++ strength is speed. Write a simple piece of computation in your favorite language (Ruby for instance). Write the same in C and measure the time it takes.
Once you see how slow Ruby is, you may get excited by C enough to continue exploring it.
Re: Ask HN: How do I learn C and C++ when I love high-level languages?
#40I can't think of anything that I will like to make in C/C++ Let me address the motivation issue. C/C++ strength is speed. Write a simple piece of computation in your favorite language (Ruby for instance). Write the same in C and measure the time it takes. Once you see how slow Ruby is, you may get excited by C enough to continue exploring it.