Take the 2-minute tour ×

I have often thought about trying to learn a language like C++ to get a better understanding of computers. To me knowing C/C++ is like the black belt of programming. But then you look around at some great developers and I don't think that they have ever learnt C++.

Is it a good idea for some rainy day (more like rainy year) or should I just keep pushing the boundaries on the languages I already know.

EDIT: To answer some questions. I have a good couple of years of experience in Java. Have worked quite a bit with Delphi and about a year and half ago started using C# for some web applications I had to create.

share|improve this question
should this not be community wiki? –  lothar Apr 14 '09 at 17:33

26 Answers 26

up vote 13 down vote accepted

I suggest that you read this book: http://csapp.cs.cmu.edu/.

It's an extremely good reading for any programmer. It will really teach you how your programs work at low level.

This book uses assembly and C, but I don't really know if it's readable without C knowledge. Anyway I suggest not to spend much time to learn C. You would probably need at least a year before you begin to understand how to write good C programs (I needed two years, personally).

C and C++ don't teach much about low level stuff (yes, I know many people claim the contrary). You learn to allocate/deallocate memory yourself, but I think that's all about it. On the other hand, the book I linked above will teach you how to write your own memory allocator, how to optimize programs, and much more.

share|improve this answer
Good book indeed. –  Liran Orevi Apr 14 '09 at 13:48
Yay, +1 for stating that C/C++ don't teach as much low level stuff as people often believe. –  jalf Apr 14 '09 at 13:53
Um, you do realize that the book you linked to uses C to teach low-level stuff, don't you? –  TMN Apr 14 '09 at 15:26
I mentioned it in my message. –  Bastien Léonard Apr 14 '09 at 16:38
do you know the asm keyword? -1 sorry - c++ teaches as much low level as you are prepared to learn –  Michael Apr 20 '09 at 12:39

Every single language and tool you learn makes you a better programmer. Yes.

share|improve this answer
If someone votes this answer down, I request you give a logical explanation as to why you are voting it down. This is what I've been taught from hundreds of sources. I don't see how it can possibly be wrong. –  Rayne Apr 14 '09 at 13:03
People downvoting this answer make me lose hope in society. –  Juliano Apr 14 '09 at 13:10
It's been downvoted twice so far. No one has explained why. –  Rayne Apr 14 '09 at 13:11
SO has its fair share of idiots, I'm afraid. –  anon Apr 14 '09 at 13:19
Maybe we don't agree on what a “better” programmer is. If you already know C#, what's the point in learning Java? Maybe you will find a job more easily, but to me that doesn't make you better. My point is: learning a new language which doesn't teach you new principles is of little or no interest. –  Bastien Léonard Apr 14 '09 at 13:59

Of course it really depends on where you want to improve. If you are to do some systems programming, for example, then you should. However, if you want to develop on the web apps front, don't bother. For more detail on this, see: Which sector of software industry uses c++

The first thing to remember when starting to learn, though: There is no such language as C/C++.

share|improve this answer
Nice answer and good references. :) +1 –  jalf Apr 14 '09 at 13:58

Expanding your knowledge base is always encouraged. And as often stated by Joel Spolsky.

His argument is, that it is like driving with a stick and know about the mechanics, coding in C (or easy-to-use assemble) helps you to understand what’s going on under the hood

share|improve this answer
Agreed - learning C or C++ won't make you a better programmer because you "learned another language", but because the nature of those languages requires a different level of understanding what's going on under the hood, and that will certainly make you a better programmer. –  Matt Apr 14 '09 at 13:17

I would learn C++ templates as a brain exercises. This as any other programming technique will force you to think on a task in a more wider basis.

share|improve this answer
heh, "brain exercises". That's a good way of putting it. +1 :) –  jalf Apr 14 '09 at 13:51

Knowing language doesn't make you a better developer. Applying the language in a right way( most of the time avoid abusing the language concepts).

using the Power of the language makes a better developer

share|improve this answer
+1, you've got it ^^ –  Martin K. Apr 14 '09 at 12:51
Not -1, but knowing a language enough to be practical does make you a better developer; you'll be better able to find a useful tool for a job and you'll better cement other concepts you know about by doing them in different ways. –  Adam Hawes Apr 14 '09 at 12:59
To know a language, but apply it incorrectly most of the time seems unlikely. –  Don Reba Apr 14 '09 at 13:07
That requires that you actually /know/ the language. I don't know what you are getting at bro... –  Rayne Apr 14 '09 at 13:13
We don't live in ideal world. knowing C++ concepts was just enough then we don't need Effective C++ by scott meyers! –  aJ. Apr 14 '09 at 13:16

There is nothing special about C and C++, other than:

  • C is a remarkably unambitious language. Its goal is/was more or less to create a portable assembly language. Anything more advanced than that, has no place in the language. As such, language-wise there is nothing to learn from C. It's in no way a difficult language, but it requires a lot of work to achieve even the simplest things. And it is of course very error-prone and unsafe compared to higher level languages.
  • C++ is a remarkably complicated language. It has had a lot of different influences over the years, and has stolen ideas from a wide range of languages and programming paradigms. And then in the last decade or so, this has been topped off by the C++ community pretty much inventing their own paradigm (generic programming). As such, C++ has come up with some pretty clever solutions to a lot of common (in all languages) problems. As much as people like to look down on C++, I frequently miss it when working in C#. There are a number of high-level techniques and abstractions that are simpler, cleaner and more elegant in C++. So from a pure language perspective, I think C++ is worth learning. (And I wish Javas or C#'s designers had bothered to do that, rather than basing their languages on what can be more accurately described as "C with classes".

But I think what you're getting at is that learning these languages will give you a better understanding of "what's going on under the hood".

I can see the point in that. C/C++ gives you pointers which can be almost mapped directly to the underlying memory addresses. Learning these languages certainly gives you a kind of intuition about what's going on underneath. (But as always with intuition, it's not always correct. One of the most common mistakes in C++ is to assume that "pointers are memory addresses". They're not. In many ways they behave similarly, but pointers obey a lot of additional constraints that may or may not exist in the actual hardware.)

So for these things, why not go directly to the source? Learn assembly, learn about the CPU itself, learn about compilers.

All of the above is worth learning, and will make you a better programmer. But learn C++ for the sake of the language (it's not beautiful, but there are lessons to be learned from it), and learn about all the underlying mechanics (compilers, the hardware you're running on, the CPU) by studying those directly.

But whatever you go for, definitely diversify. You should learn the languages you actually work in, obviously, but don't stop there. Learn something else, almost regardless of what it is. More languages, or a better understanding of the underlying infrastructure, it'll all make you a better developer.

Finally, don't think of C/C++ as the "black belt". C++ in particular may be one of the hardest languages to master, but that doesn't mean those who know it are the best programmers. Far from it.

share|improve this answer
Actually, I have mapped pointers directly to memory addresses. Very handy when you're using memory-mapped I/O and control registers. –  TMN Apr 14 '09 at 15:30
Like I said, there are strong similarities, but they are not the same. there are things you can do with memory addresses according to the underlying instruction set, that you can not do with a C++ pointer. In some pointers can be treated as memory addresses, but not always. –  jalf Apr 14 '09 at 17:40
+1 This is an epic answer. Why so many years later, does it only have +5? –  NlightNFotis May 12 '13 at 14:36

There is a great article on self-improvement in programming: "Teach yourself programming 10 years"

It says, that it is always good to learn new stuff. C++ is hard to learn, and even harder to master.

But it teaches you all sort of low-level processing, that is crucial to understand when writing large-scale software.

share|improve this answer
Thanks for the article. –  Liran Orevi Apr 14 '09 at 13:14

Knowing C/C++ makes you a more useful developer. C/C++ are quite pervasive and the syntax of many other languages is derived from them.

It never hurts to learn C either, because it really hides nothing from the developer. You'll learn about compiling, linking, libraries, etc in gory details. You'll learn about raw system calls and machine architecture; things that higher level languages hide from you with their own abstractions of concepts.

Learning another language well enough to solve practical problem will make you a better developer simply because now you have a new tool that can be applied to solve some problems better than other tools. More tools is always useful. Learning the new ways of solving problems in another language will further cement your knowledge of concepts, design patterns, data structures, etc. It can only be a good thing!

share|improve this answer

There has been great debate about this by Joel and Jeff on early podcasts and it is inconclusive and very controversial.

Like most older programmers (not giving away my age here) I tend to believe that the more you know about the underlying system and its inner workings, the better you will make use of more modern and abstracted ways of programming.

Therefore knowing about (m)alloc (allocating memory for a variable like a string or structure) and thus understanding why some string manipulations are slow in high level languages can be profitable. This is just one example.

If you want to learn about OO concepts, there are better places to go then a hybrid language like C++ (can feel the break between OO and non-OO layer).

So, I would say, having a look at C can't hurt.

share|improve this answer
C++ doesn't "just add an oo layer". It adds a lot of far more interesting features than OOP, and it is worth learning for those other reasons. Screw OOP, that's so last decade ;) –  jalf Apr 14 '09 at 13:54

I would say that every new language improves your programming skills, so learning new ones is always a good idea. However, I find that learning languages belonging to other paradigms than the one I'm currently most used to is a smashing way of becomming a better programmer. For example, learning prolog made me truly understand recursion for the first time, smalltalk and ruby helped me understand the beauty of dynamic typing, lisp just blew my mind and C made me realise what was going on behind the curtains...

If you're thinking of learning a new language, I say go for it. C will help you understand memory allocation like nothing else (unless you're going for even nitty-grittier stuff like assembler), and C++ will help you love any other language you may know so much more. ;)

Best of luck!

share|improve this answer

C++ - I'm not sure.

C - certainly:

  • It will make you aware of memory mennagement - e.g. nobody who does not "think" C can understand, or think about Apache pool

  • It will make you aware of performance issues like vector/bit-set computation and loop unrolling (because sometimes you'll do it by hand)

  • You'll feel more comfortable with Unix

  • C is still the industry lingua franca

share|improve this answer

if you learn C + +, consider using these books:
Effective C++
Code Complete

share|improve this answer
Thanks for the resources :D –  uriDium Apr 14 '09 at 18:59

It's never bad to know a language more! If you learn C and Assembler, you'll see how it all started. This is really helpful for talks at meetings ;)

Thats more about you, than your programming skills.

share|improve this answer

Yes. (kind of)

Every single time you program in a memory-manged language you allow the compiler to do work for you, and over time you come to rely on things that you have little or no knowledge of the inner workings of.

In a non-memory managed language like C or C++ you have to spend time thinking about where a pointer will point to at the end of a method, whether to pass by reference or return a variable, and other things that make you think about the code you're writing in a far more objective way.

The thing is, the ability to know things like whether using a vector or an arraylist in java is the right way to go can never be learnt until you understand the fundamental concepts behind many of the data structures you use on a day-to-day basis.

So yes, learning to use C or C++ will make you a better programmer, but whether you choose to take this knowledge and use it to make you a better developer is your choice.

share|improve this answer

Learning another language will make you a better coder. Especially when the language's paradigm is significantly different from any other language you already know!

Learning C will give you a much better grasp of what you are actually doing. It will be like being accustomed to a full featured graphing calculator and then learning to do all the arithmetic, algebra, calculus, and graphing yourself with just a blackboard and chalk. It will be a lot of work, but if you succeed, your mental model of the code will be much closer to what is actually happening in the machine.

This isn't really necessary to be a good coder. Actually, I believe one of the characteristics of a good coder is the ability to understand the code in a higher level of abstraction, and to see the system as a whole. Low level knowledge doesn't help you with the big picture. However, if you want to be great, you have to move beyond just good. You should be able to understand the system at many different levels of abstraction from the upper conceptual diagram level down to the bare machine code level. Knowing C will help you with understanding the low levels. Being able to debug C will help you with troubleshooting at all levels!

C++ allows you to do the low level operations of C, but adds a bunch of abstraction mechanisms and code reuse facilities so you can be a little more productive. If you already know a higher level language like Python, Ruby, Perl, VB, Java, and so on, I would recommend that you make some effort to become skilled in C and not try to tackle C++ just yet. The purpose of learning another language should be to expand your horizons. That way, even if you don't end up using it in a professional or hobbyist capacity, you will still improve your coding and analysis skills for the languages that you do use.

share|improve this answer

One of the most important things when designing applications is the amount of user code/libraries around the language, code snippets, tutorials and everything else.

That said, C, altho old language, is what Esperanto should have been in human languages - the language everybody should know :)

Why ? Its not important. Whats imporrtant is that you will encounter C everywhere around.

share|improve this answer

Coding in C gives you a closer perspective to what the real system is doing. It is really "coding to the metal" of the machine.

It also gives you a deeper appreciation for what languages like Java/C#/Python/Ruby are doing for you.

And finally, a vast majority (though not all) of nix/BSD code is written in C, as well as many modern systems, so knowing it opens the doors for you should you be considering a patch, or trying to join a team at a certain company.

share|improve this answer
That is another motivation. To get involved in open source projects because then I will have a lot of people looking at my code and giving me pointers. –  uriDium Apr 14 '09 at 18:59

Are you talking about C or C++ ?

You don't say what you currently know. If you've not done C, I would certainly recommend it. It will help you understand what's going on at the low-level, close to the metal. Its design and styling influence so much of current language/script implementations.

If you want to learn an OO language, I would perhaps suggest a simpler introduction to OO - perhaps Java or C# initially. C++ can be a intimidating introduction to this subject.

share|improve this answer
Or Scala. Scala is more OOPish than Java. :p –  Rayne Apr 14 '09 at 12:48
But also more complex and functional.! –  Martin K. Apr 14 '09 at 12:50
Yes. I think the functional aspect will obscure the OO concept from the POV of learning OO as a concept –  Brian Agnew Apr 14 '09 at 12:51
Sorry, have edited my question to include which languages I currently know. –  uriDium Apr 14 '09 at 12:59
More complex and functional, how? The functional aspect can in no way cloud the OOP learning experience. It's not OCaml for Heaven's sake. –  Rayne Apr 14 '09 at 13:04

Yes, if you mean knowing in depth, not just some basic knowledge. C++ combines proximity to the computer internals with high flexibility so deep knowledge of C++ implies you understand how a computer works very well. And the latter certainly gives you an edge.

share|improve this answer

There is a saying:

You're worth as many people as the number of languages you know .

That's the only real reason to learn them ;)

share|improve this answer

It might. There are some very important concepts that are shoved in your face particularly in C that you have to deal with.

I'd say take it a step further and learn assembly. I've never programmed professionally in any assembly language, but the time I spent working through every chapter and exercise in Assembly Langauge for the PC has payed the most dividends of any of my studies, school or independent. You will know what a pointer and an offset is, you'll have a deeper understanding of why character encoding matters, you'll know about the stack and the heap, memory management, etc. You may never use any of that directly, but it will make yo u a better programmer.

share|improve this answer

A programming language is just a tool. To be get better, you have to know your tools better, whether your tool is C/C++, a paintbrush, or anything else.

share|improve this answer

You should try to learn C and you should try to learn C++. When you do, you soon realize why I separated the two.

It will make you a better programmer too, because you will learn more about the machine the code is running on compared to the languages you know so far. That in itself would already be reward enough. Learning C++ might also make you learn multiple inheritance which is another useful programming concept that is not so wide-spread around other languages. If you learn to use the preprocessor well, then you certainly miss it in other languages as well.

However, one thing to keep in mind: to really learn these two languages takes a long time, because it is not enough to read about them. You need to work with them and solve real problems. That is the most rewarding part when learning these languages, but it is also the most frustrating and time consuming part. I am learning for 10 years now and I feel unable to say that I now know both languages. I feel quite comfortable, but I know that I am far from perfect.

share|improve this answer

I suggest you to learn C language. This will help you to learn everything about computer programming. To me there is a good book available for programmers to learn C programming from programming to memory management, OS concepts and other stuffs.


have a look at this web book you will able to know how powerful the language is....

share|improve this answer

If I had to answer your question in one word, "YES". It's good to master at least one language, but it's always better to learn more than one... who knows what happens tomorrow.

As far as understanding of computer goes, C++ may not be that very helpful, but C++ does provide you a lot of options while programming.

And yes, does learning it make you a better programmer? It does. Every language is unique in certain aspects. Learning more languages helps you explore the possibility of implementing the uniqueness of one language in another.

share|improve this answer

Your Answer


