How can I gain a deeper understanding of C/C++?

Started by
53 comments, last by Irlan Robson 10 years, 3 months ago

Hello,

So after going through these slides (they're very interesting, btw! I suggest you go through them), I realized that my knowledge of C/C++ isn't as deep as I thought.

Does anyone with a very concrete understanding of C/C++ have any advice for becoming more like the girl character? Any book recommendations/practices? I know that simply programming every day is the first step, but I'd like to supplement my programming with any extra information I can get.

Advertisement

Program. A lot. Then have someone review your code. Then review someone else's code. Then program some more. There's no substitute to experience.

If you are not a beginner, 'The C++ Programming Language' is the C++ bible, thought it doesn't cover C++11 yet. Not sure if there are any good C++11 book available yet.

There are a bunch of other C/C++ books out there. They will mostly teach you the language, not how to code.

What I find disturbing in most books, is that for the most part they tell what the features are and how to use them, but they will not tell what not to do, which is equally important.

A lot of the coding and debugging horros I encountered were caused by inappropriate use of C++ features.


Not sure if there are any good C++11 book available yet.

Might I recommend "The C++ Programming Language" for an excellent book that covers C++11.

And, yeah, the way to get good at something -- anything -- is to practice. 10,000 hours. Write, code, debug, maintain. It's just that simple, really.

Stephen M. Webb
Professional Free Software Developer

For a lot of that, you'll want to read the actual C and C++ standards or at least the final draft versions of the various standards. It's hard to have a good language lawyer throw down about details without being able to refer to the standards.

Ouch, after going through all of those slides I've suddenly become depressed about my knowledge.

"I would try to find halo source code by bungie best fps engine ever created, u see why call of duty loses speed due to its detail." -- GettingNifty


Not sure if there are any good C++11 book available yet.

Might I recommend "The C++ Programming Language" for an excellent book that covers C++11.

Damn that Amazon search, somehow I got the third edition of the book first...

This is probably a little extreme, but in addition to just programming a lot and learning from other programmers, you really should try to learn about issues in programming language design and compilers, and should at least build a compiler. It provides huge insight into why programming languages are the way they are, and that's a huge advantage.

http://herbsutter.com/gotw/ for all C++11 and C++14 recommendations

Worked on titles: CMR:DiRT2, DiRT 3, DiRT: Showdown, GRID 2, theHunter, theHunter: Primal, Mad Max, Watch Dogs: Legion

Do a lot of programming, and make it bigger and bigger too see how repetitive your code could become that you finally learn how to make stuff generic (generic programming). If you finally end up wanting to read about patterns and architecture books, that's when you realize you're getting deep. It won't be about C++ anymore, it's about the concepts, and only comes up when you face real problems every day based on your requirements.

Learning from other programmers make it quick as everyone always have opinion on the way they code, as coding doesn't always about right or wrong when it comes to patterns or architecture, it's what's fit on your current problem.

Some of the advices might be true here. But if you really want to understand how programming and computers really work together, you should learn Assembly language, at first you might be scared of it, because a lot people think it's the holy grail of programming languages, and they think that only best of the best can learn it.

While it might have some some truth to it, but even knowing a little bit of Assembly will help you A LOT! I was learning assembly for a month or so (I just really wanted to try it out), and I already understand better how linker works, how everything is compiled, how exactly stack works, where passed arguments go, memory management, and all that stuff. I can even write my own simple x86 kernel!

So if you want to get started, download or buy a book called "Assembly Language Step by Step". It is meant for total newbies who want to learn Assembly as a first language, and he has some good points on why one should learn Assembly as first language, and not Python or Java as other people tell you.

I promise, you will gain a better understanding of programming langues and deep C.

Afterwards you might even want to disassemble your C code and read it in Assembly to better understand how things work inside.

Also, I checked out those slides, I saw few parts where it talked about registers, data segment, and other stuff I wouldn't probably have known before reading book on assembly.

So go learn some Assembly and good luck with your learning! smile.png

“There are thousands and thousands of people out there leading lives of quiet, screaming desperation, where they work long, hard hours at jobs they hate to enable them to buy things they don't need to impress people they don't like.”? Nigel Marsh

This topic is closed to new replies.

Advertisement