Thread: How do I master C++ ?

  1. #1
    Registered User
    Join Date
    Nov 2014
    Posts
    6

    Question How do I master C++ ?

    Beginner here ... How do I master C++ ? How long did it take you to master it ?How long before I can learn open_gl ? What books should I read ? And give me some books with excercises only thanks !

  2. #2
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    How long did it take you to master it ?
    O_o

    I'll let you know when I get there...

    Soma

    [Edit]
    Accelerated C++
    The C++ Standard Library
    Effective C++
    More Effective C++
    Effective STL
    Exceptional C++
    More Exceptional C++
    Exceptional C++ Style
    C++ Templates
    C++ Template Meta-programming
    [/Edit]
    “Salem Was Wrong!” -- Pedant Necromancer
    “Four isn't random!” -- Gibbering Mouther

  3. #3
    Guest
    Guest
    I'm at a medium level (and plateaued there due to lack of drive), but I think you can get a good grasp of the basic language features in a matter of months. The way I see it, OpenGL is entirely a beast of its own and you don't need to know advanced C++ at all to work with it. If you are new to C++ and aim for OpenGL mainly, I recommend you start familiarizing yourself with computer graphics (geometry, matrices) and OpenGL concepts (the shader pipeline) without worrying about the code/API yet. You eventually need to do this anyway, regardless of your proficiency in programming languages. Even if you skim the surface for now, it will accelerate your progress when you tackle the topic in more depth, because your mind will have already built a scaffolding for you to flesh out.

    The C++ parts you need a good grasp of for OpenGL are those also found in C, namely: types, arrays, pointers, functions.

    Make sure you only read/watch modern OpenGL 4 material, as the language underwent a significant change at that point. The web is full of old material that would mostly waste your time.
    p.s. the often touted "OpenGL programming guide" is a terribly written book (in text and code) in my opinion, avoid.

  4. #4
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    Practice.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    How do you master it? Well, if I knew that answer, I'd probably have mastered it long ago.
    Jokes aside, the way you do it is as with every other language (hint: what whiteflags said)-
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Registered User
    Join Date
    Nov 2013
    Posts
    107
    I would recommend reading some books like Master of Doom, or follow John Carmack on Twitter and plenty other books and people to follow also. These guys will constantly tell you that they are still learning all the time, they are still making tons of mistakes, have many headaches and long hours over simple bugs.

    Point being is that you could argue that you are always learning.

  7. #7
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    I've been doing C++ at my job, more-or-less full-time, for the last 8 years, and I'd say I'm far from being a "master," as you put it. I try to learn something new every day, and rarely miss that goal. Much of what I learn these days comes from reading posts on this forum, from veteran members such as Salem, Phantomotap, and Elysia. You'd be wise to read their responses to the various threads on this forum.

    OpenGL is something you can start learning as soon as you feel comfortable with the language in general. Until you are completely comfortable with pointers, I wouldn't recommend working with any third-party library.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  8. #8
    Registered User
    Join Date
    Dec 2013
    Posts
    241
    just about you think you got a good grip of things, the comitee releases a newer standard.. this cycle never ends (and it better not)!

    one thing I do think many people are missing these days , is the low level memory managment - raw pointers, pointers to pointers, arrays and pointers, dynamic memory allocation etc.
    many programmers think of this knowledge as C technics and therefor try to not tackle this knowledge directly
    understanding this stuff (although you can always find a workaround) is a funamental step of understanding C++.
    Last edited by Dave11; 05-30-2015 at 10:49 AM.

  9. #9
    Registered User MutantJohn's Avatar
    Join Date
    Feb 2013
    Posts
    2,665
    Why would you ever want to master C++ and not programming or computer science in general? Abstracting concepts into a series of computations is forever but like all things, hardware, languages, etc, are just finite.

    Like, what will happen when quantum computers happen? "Mastering" C++ will have fundamentally proved useless because it'll be a "dead" language.

  10. #10
    Registered User Alpo's Avatar
    Join Date
    Apr 2014
    Posts
    877
    I've learned C++ for over a year, have read 2 of the books on Soma's list, and still suck :P. I don't think you can master "C++" because it's too nebulous and touches on too many things.

    The best I try to shoot for is understanding enough of the language to be able to express concepts of the fields I'm interested in. Keep in mind a lot of the knowledge from those fields (graphics, GUI's, gaming, networking, ect) has nothing to do with the language itself. C++ is just a lens you can look through to view that knowledge.

    Ideally I think you can learn OpenGL when you are comfortable enough with C++ that you can see through it to the concepts being expressed by OpenGL.
    WndProc = (2[b] || !(2[b])) ? SufferNobly : TakeArms;

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Dave11 View Post
    one thing I do think many people are missing these days , is the low level memory managment - raw pointers, pointers to pointers, arrays and pointers, dynamic memory allocation etc.
    many programmers think of this knowledge as C technics and therefor try to not tackle this knowledge directly
    understanding this stuff (although you can always find a workaround) is a funamental step of understanding C++.
    Most of that stuff you don't need to worry about most of the time because it's low level, and things like that tend to be abstracted. Furthermore, C++ tends to offer a lot of high level tools, so you don't often need this stuff.
    I would argue, however, that understanding pointers is important (yes, including raw pointers; but not necessarily for memory allocation, but for aliasing data between different data structures). Arrays are a given too. But again, neither of these is limited to low-level memory management. Low-level memory management is something you rarely have to do unless you're implementing time sensitive containers or algorithms. So no, I don't think they're fundamental to understanding C++, but yes, they are indeed part of the language and has their place. It really depends on where you want to focus your efforts.

    I like to at least divide programming into two areas: systems programming, which usually entails constructing various high-level objects and piecing together these to form a system. You usually don't need low-level memory management here. Then there's the close to the metal area which is all about optimizing performance and memory. This is where you really need low-level memory management knowledge. This is the area where you need to know and use the low-level constructs. This is my experience, at least.

    Quote Originally Posted by MutantJohn View Post
    Like, what will happen when quantum computers happen? "Mastering" C++ will have fundamentally proved useless because it'll be a "dead" language.
    Highly unlikely. For one, we don't know what quantum computing will even do to the world of computing. Then there's just the fact that there's tons of legacy code written in C/C++. That's not going away. IF, and I really emphasize the IF, C++ is going away, it's going to take at least 30+ years. That's a long time! And who is not to say that C++ will evolve with other languages to challenge the problem of quantum computing? We don't know, and we'll never know for sure until quantum computing hits. So that's a very big assumption.

    Quote Originally Posted by Alpo View Post
    I've learned C++ for over a year, have read 2 of the books on Soma's list, and still suck :P. I don't think you can master "C++" because it's too nebulous and touches on too many things.
    You're not going to become "good" in a language if you've only studied it for a year. That's true of any language.
    Last edited by Elysia; 05-30-2015 at 05:24 PM.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Registered User
    Join Date
    Dec 2013
    Posts
    241
    @Elisya : not trying to turn the discussion around, this is the difference (in my opinion) between just "knowing how to do stuff in C++" and "mastering C++".

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Master mind
    By KaiZ023 in forum C Programming
    Replies: 3
    Last Post: 11-15-2010, 08:47 AM
  2. The Master has died...
    By Mario F. in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 03-21-2008, 04:32 AM
  3. New contest master
    By webmaster in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 08-01-2003, 11:05 PM
  4. to: master o' web... and other ones of you as well...
    By doubleanti in forum A Brief History of Cprogramming.com
    Replies: 13
    Last Post: 08-16-2001, 05:34 PM