Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I'm a beginner and have only little knowledge in programming.

Would it be good if I directly learn C++ from books which cover new C++11 or should I study through the old best C++ books?

Should I have little knowledge about C++ before learning C++11? or I can start directly from there?

Would it cause problem if I directly start from C++11? If no, then suggest some books on C++11.

share|improve this question

closed as off-topic by Thomas Owens Feb 1 at 14:17

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions asking us to recommend a tool, library or favorite off-site resource are off-topic for Programmers as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Thomas Owens
If this question can be reworded to fit the rules in the help center, please edit the question.

11  
Why those negative points? Has this questions already been answered? Aren't newbies allowed to question? Hoes does someone reasearch in this matter? I think one of the best ways is to ask to ones with more experience. +1, as newbies also deserve to be guided –  adosaiguas Aug 28 '12 at 14:54
    
@adosaiguas well... from the faq: Programmers — Stack Exchange is a site for professional programmers who are interested in getting expert answers on conceptual questions about software development. –  Simon Aug 28 '12 at 15:37
9  
@Simon this sounds to me as a conceptual question about software development: Where do I start? And how do you know he is not a professional programmer? ;) –  adosaiguas Aug 28 '12 at 15:44
4  
@MSalters Talking about books; Accelerated C++ is an awesome book, albeit a bit simplified. Barbara E. Moo is an awesome writer and her influence on the book is easily noted. But the book in question indeed is "old". However not all hope is lost - there's a highly-rated book called C++ Primer by Lippman, Lajoie and Barbara E. Moo, the fifth edition was published this month(August 2012) and from the first few chapters I've been reading from my copy, this is an excellent book covering C++11. Moo's influence is present, again. She's a goddess when it comes to technical writing. –  zxcdw Aug 28 '12 at 17:43
2  
I think this question is clearly off-topic due to the FAQ (maybe it was not at the time is was asked first). It asks "which language (version) should I pick up next", it is about education advice and it asks for off-size resources - three of the standard closing reasons. –  Doc Brown Feb 1 at 10:01

11 Answers 11

up vote 33 down vote accepted

There are a lot of usability enhancements that make C++11 more comprehensible to a beginner, especially one who has experience in other languages with those features. Other changes in C++11 are only of interest to advanced users, so you're likely to get overwhelmed if you pick up a book that is designed to mostly teach the differences. Make sure any book you get is designed for complete beginners to C++.

That being said, you'll probably have to learn the old way eventually, as there is a lot of existing code out there, and even new C++11 code will contain the old way of doing things if the programmer so chooses. I write C++ for a living, and my company still hasn't even gotten around to evaluating C++11-compatible compilers, let alone using one in production.

share|improve this answer
    
i m learning from c++ primer 4th edition. good book to start with ?? –  Dhananjay Aug 28 '12 at 18:28
1  
It gets good reviews and looks to be at the right level, but I haven't looked at beginner-level C++ books in a long time, so I'm not the best person to ask. I think you'll need the 5th edition if you want C++11 covered, though. –  Karl Bielefeldt Aug 28 '12 at 19:19
    
its ok and yah i know that 5th edition cover c++11 . –  Dhananjay Aug 29 '12 at 6:20

the better thing is to start with C. before this you have to learn all the basics about programming. That is what is variable? how the values are stored? etc. apart from this have to increase your logical thinking.

share|improve this answer

Despite many improvements in C++11, C++ is still not an easy language. Java, while not as easy as some may think, is still an easier language with very good performance (often almost as fast as C++) and offers better IDEs (maybe Visual C++ is as good as current Java IDEs but no luck here on Linux), a much more comprehensive standard library (the JDK), more libraries (e.g. Hibernate, Spring, JEE, Lucene, etc) and no memory leaks (well, almost none – you can still build a memory leak in Java but it is more difficult to do so than in C++). To be fair, with modern C++11, it is much easier to avoid memory leeks.

C++11 has many cool features like lambdas, auto keyword, move semantics and much more. It is definitely a much better language than C++98 was. See this overview by Herb Sutter about the new features in C++11: Elements of Modern C++ Style.

To sum up, I think everyone should learn at least some C++. If you have been programming in Java, Scala, Ruby or Python for the last decade and never touched C or C++, now with C++11 I think it is time to learn C++11 and improve your programming skills while doing so.

I probably won’t be using C++ much at work in the coming years and when I need a more powerful language than Java, I will probably go for Scala, but I will have a closer look at C++11 and try to learn and understand the new features, particularly those about multithreading and concurrency.

Remember: It always helps to learn a new programming language even when you don’t plan to use it in production.

share|improve this answer

As a beginner I think first you have to go through C++ concepts because C++11 and all is like a new version but C and C++ are the basic for any type of development. Once you learned C++ most of the concepts will get automatically cleared.

share|improve this answer
1  
Welcome to Programmers! I'm not sure your answer adds all that much to this question; and grammatically speaking a bit of a mess. I am having trouble following what you are trying to say. Could you expand on your answer, perhaps add examples on why C++11 differs so much that learning C and earlier versions of the C++ standard is better? –  Martijn Pieters Jan 29 at 8:25

When my time, C was considered a prerequisite of C++, especially for those beginners of programming. Because you have to figure out what does a language do and why it has been designed like that. C got loads of great and sufficient ideas of programming language, which will never be out of date. Thus, I believe this is the best start.

And after having some basic point of view regarding the programming stuffs, you may have to choose what to be done as the next move, which means, choose a language to learn as deeply as you could. No matter how deep you get, it can generally decide how deep you can get for any other languages, which means, no matter how many languages you have learned, the deepest one will always be the first one that you have dug up. For me, I have performed research on Java and made some models of Java on my own to better understand its kernel functionality.

After that, you might be able to learn whatever you want, because you have totally understanding on the technology of the programming language. I have started learning C#, Go, Python even Scala and have done many projects for fun/work. The personal record is 3 months from starting learning a language to becoming 1.0 head of a developing project.

In my case, it has been over 15 years since my first program and I cant even remember what it is. I believe if you work hard enough, you will definitely get better and faster than me.

share|improve this answer
    
this does not answer the question asked –  gnat Jan 29 at 6:10
    
Totally, sorry. Just want to say, neither. It doesn't matter what you want to learn finally, only the basis of programming language can decide how deeply you can dig up in this field. At the same time, you have to spend more time on it rather than a quick shot. –  WinstonWu Jan 30 at 1:19

It's hard to say.

Old C++ is more of a minefield, and it's nice to learn how to navigate such a beast. It will also make you understand why things are done how they are, and what the implications of different constructs are.

Then again, old C++ is not what you want when you write code.

But then, yet again, old C++ is what a lot of industry will be churning on for 20 more years.

I love C++ 11, but it is only usable in startups for now. Not in large legacy code bases. And jumping straight to C++ 11 might leave you with undeveloped skills in nasty C++ parts. Which will backfire once some advanced C++ 11 construct leaks, or crashes because it's used in a syntactically correct, but logically incorrect way.

share|improve this answer
    
Why would major parts of industry not update there compilers, besides the niche embedded systems field? Risk (even with unit tests)? Conservatism? –  TheLQ Aug 28 '12 at 15:55
1  
@TheLQ: I guess... But when I think what I would do if I were a boss, it's highly likely I would do the same thing. Unless there are some noticeable cost savings vs. migration costs. –  Coder Aug 28 '12 at 16:03
1  
@TheLQ: It takes yeas for code bases to move to a newer version of the compiler. It is rare that a project will adapt a new compiler version willy nilly. A new project is more likely to use a new compiler (as long as it does not interact with old code). –  Loki Astari Aug 28 '12 at 16:08
1  
@Coder: What makes C++11 that different from C++03 that learning it will not translate directly to C++03. There are a couple of new features that make things easier to write but nothing that prevents you stepping in those minefields. –  Loki Astari Aug 28 '12 at 16:10
1  
@TheLQ: yes that is basically the processes but you forgot integration testing (the most complex part. Not all applications are standalone (infact I would say that this is the minority)). You need to verify that all your code works and interacts correctly (not only with your code but with customer code). This is a processes of months if not yeas of testing and validation. If some of your customers are not moving to C++11 then you may need to maintain both version on some systems (luckily gcc is very good with backward compatibility but not all C++ compiler vendors are). –  Loki Astari Aug 28 '12 at 16:32

C++ Is a really great and powerful language. However it also places a lot of responsibility on the programmer.

If you are completely new to programming, make life easier for yourself and start with C#. It's syntax is based on C++, but the error handling is much more beginner friendly in assisting you when things go wrong.

If you are comfortable with methods, classes, inheritance and are wanting to develop in an environment where managing memory and system resources is more important than productivity, then C++ is a good choice, and I would start by learning the current standard. Bare in mind that C++ requires you to understand memory and to actively manage it. Make mistakes here, and all you get is either a core dumped, or your data contains bytes that don't make sense. And often the point where you find the problem is unrelated to where the cause actually is.

share|improve this answer
1  
If one starts with C#, (s)he will get used to program on a high level (OOP, automatic memory management) without actually knowing what happens "behind the scene". If that person then moves to C++, (s)he will lack important knowledge about C/C++ (I'm thinking mostly of memory management, but there's more). It might be even more misleading due to the fact that C++ and C# share a very similar syntax, but what the code actually compiles to, is totally different. Keep in mind the OP clearly stated his interest in C++. –  Mr. Pixel Jan 29 at 9:46
    
The OP also stated they have little knowledge of programming. learning your first language as C++ is huge challenge. Far better to pick your battles and choose a series of smaller ones, as you are much more likely to succeed. –  Ptolemy Jan 29 at 14:55

Recent introductory books about C++ are increasingly covering C++11 as well. I read Sam's Teach Yourself C++ after working with scripted languages but not C/C++ for almost ten years and found it really helpful. I very quickly became conversant in the central ideas of C++ (including a lot of STL) and conscious of a great many details which are different in C++11.

As some other posters have mentioned, C++11 is in many ways easier than older standards with scripting-style additions like auto, for(int &i : m_vector){} etc. So if your "little knowledge" comes from languages like Python or Matlab, you will find C++11 somewhat more "natural" than the earlier standards.

I would also point out that by now, compiler compatibility for C++11 is (almost) complete so having code that is "too up to date to compile" is no longer an issue.

In short, do it.

share|improve this answer

You do not need to use old C++ to start using C++ 11, there are new features in C++ 11 but there use is optional. Knowing how to use C++ 11 features could be an advantage, it certainly wouldn't be a disadvantage when working with legacy (pre 11) code-bases once you knew the idiosyncrasies of the older versions.

Learn C++ would be a good place to start learning and Appendix B will teach you the C++ 11 features after you have learnt the basics.

I can see why some people have suggested Java/CSharp etc. as easier alternative languages but I learnt a bit of C++ before moving onto CSharp and I'm not a worse programmer because of it, to the contrary programming skills go much deeper than language syntax/functionality and with a solid foundation in C++ you could learn any other imperative OOP language easily.

share|improve this answer

Why do you wanna start with C++?

I personally recommend against C++ as a first language. It is tricky, complex, difficult... simply much lower level and more "unsafe" than most other programming languages.

I advise to pick c#, java, python or javascript ...and a good book along the way. You'll have a much more enjoyable time with these.

share|improve this answer
3  
I do disagree on that as a generalization. Going from the easy life of java/C#/python etc. to a more complex world of C and C++ is not that easy. If you are really set on learning a programming language, learning C and C++ is hard, but will give so much back. If you later wants to program in java, C#, python etc. that change is a lot easier than going from them to C or C++. Summary: C/C++ will be harder to start with, but will make changing to any other OO language easier. –  martiert Aug 28 '12 at 15:22
2  
C++ is the best foundation to start. Programming is complex, and in the end you have to work with a hardware. C++ is an amazing way to start learning that without false sense of security. –  Coder Aug 28 '12 at 15:24
    
The op's question completely rely on his/her purpose with development. –  Independent Aug 28 '12 at 15:43
1  
I disagree with this. Learning C++ has several advantages and makes it easier to learn other languages like Java and C# to name a few. –  Anthony Aug 28 '12 at 16:22
2  
@Dhananjay: C++ is many times more difficult than java... Java is like a baby bike, an extremely simplified version of C++. The latter one would be a no-frills bike without brakes. If you already find java hard, C++ will be a pain. My 2 cents. –  arnaud Aug 31 '12 at 8:08

Take a deep breath and read this article by Peter Norvig.

Have you read that? Ok, if you are a beginner, you need to start in small steps. -insert language here- can come later, check out Coursera or Udacity for some beginner computer science introduction courses.

Having completed that, I would advise slowly working your way through K&R's The C programming language if you are set on a 'C' language.

Work on the basics, the rest will come in time.

share|improve this answer
9  
I don't see how this is answer to the question asked. C isn't even same language as C++. –  vartec Aug 28 '12 at 15:27
1  
But C++ is based on C, and is largely backwards-compatible: the vast majority of modern C syntax is directly applicable to C++. Since C is simpler than any version of C++, learning C first gives you a nice coherent education in the basic C++ syntax and semantics -- and helps explain some of the otherwise incomprehensible warts on the larger language... –  comingstorm Aug 28 '12 at 18:13
2  
@comingstorm The first thing a C programmer should do is to unlearn almost everything he knows about C, and then start to learn C++. There are subtle differences which might bite you. –  BЈовић Jan 29 at 8:56
1  
Plus idiomatic modern C++ code doesn't borrow much from C aside from syntax. It's not like we're still using C-strings and malloc/free anymore. As a complete beginner to the language you're better off picking up a book like C++ Primer 5th edition, Accelerated C++, etc instead of focusing on C. –  bstamour Jan 30 at 15:42

Not the answer you're looking for? Browse other questions tagged or ask your own question.