Jump to content
  • Advertisement
Sign in to follow this  
doyleman77

Used old C++, Sudden feeling overwhelmed.

This topic is 1931 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Back in 06 I got into programming from a buddy of mine, and asked for a book on C++ for christmas. I was 17 at the time. Anyway, unimportant. The book was Teach yourself c++ in 21 days; the only one in our local bookstore. I picked it up, and have gone over it a few times. Practiced several things, got into programming light games with SDL, Went to university, and my first day there they jumped me several classes into computer science. They moved me past about 5 computer science classes, all the way up to Intermediate C++. I'm not trying to show off, or brag, just emphasize that I seemed to think I was going places.

 

I passed the course with a B, so I thought I knew what I was doing just fine, but... Now I'm browsing the net, and seeing that what I've been doing is what everyone calls 'C with Classes'. I have barely touched on templates, exceptioins, or STL. In fact, I am embarrased to say I've never once used STL. at all. my course in college had us make our own vector, using templates (my only foot in that part of c++) to build the class.

 

Lately, my head feels... overwhelmed. I want to learn the right way to do C++; to make clean and efficient code. I feel like I almost wasted my last 6 years programming. I learned a few things, sure, but I already knew quite a bit coming from another toolkit I used for awhile; RPG maker 2 for the PS2. Sure, no hard code, but basic scripting that introduced me to control / loops / etc. But most of the C++ I have been writing hasn't really been C++. It's been classes, and C code. And browsing over what C++ 11 looks like just makes me dizzy.

 

I don't know how to word the question I have, but it's basically along the lines of... What do I do about this? Pick up C++ Primer 5ed and try to relearn? I am not sure. Thanks for any advice.

Share this post


Link to post
Share on other sites
Advertisement

This whole process is going to be a giant pain, isn't it? I couldn't stand the first 10 minutes of twilight when my sister wanted me to see it...

 

Ok, other than C++ Primer 5ed, what else should I invest in? I hear Effective C++ is a must, and probably the book from Bjarne himself. Those I hear about often.

 

Also, Money is tight, so I can't buy all outright right away; which one would take precedence (the ones I listed and/or any other suggestions you may have)?

Share this post


Link to post
Share on other sites

I passed the course with a B, so I thought I knew what I was doing just fine, but... Now I'm browsing the net, and seeing that what I've been doing is what everyone calls 'C with Classes'.

 

Which is fine, though I may get downvoted for saying so. Don't disparage yourself for having learned that much. Using C++ as an extension of C is one way of doing things. It's not in vogue, but it can make functional and effective programs, which is one of the reasons you came to rest at that point.

 

I feel like I almost wasted my last 6 years programming.


No. You've learned a hell of a lot more than most people ever will. Now you have the opportunity to learn more. Take the new concepts one at a time and you shouldn't have trouble. Start with templates, since STL is based on them, then start looking at smart pointers and understand RAII. From there exceptions become more sensible. Move on to containers, and from there you can fill in the rest. It's just like doing a tabletop puzzle. Start putting pieces together, and the more progress you make, the easier it becomes to see where everything fits.

Share this post


Link to post
Share on other sites

And browsing over what C++ 11 looks like just makes me dizzy

 

I cant see why this is, C++11 is a great improvement

 

I think what you need is a project to work with, something useful to you that can be done with programming, sure there are a lot of apps these days that do stuff but there are more that tasks that don't have apps. You will likely feel more motivated if you are making an app that helps you, don't think too big either (though depending on how much time you have this may not be a bad idea) and do it, you will eventually pick up all the things you need to. This doesn't apply to C++ either, learning a language is one thing but if the project you are doing is dull / trivial you may never learn or have fun

 

http://www.amazon.co.uk/gp/product/0321563840/ref=pd_lpo_k2_dp_sr_1/275-0198393-1684473?pf_rd_m=A3P5ROKL5A1OLE&pf_rd_s=lpo-top-stripe&pf_rd_r=0ESMKHHC1Z6HY5E5GEPB&pf_rd_t=201&pf_rd_p=103612307&pf_rd_i=0321958322

Edit: Hmm, when I read the previous version last year I wasn't too impressed with the way this was written, it read like a math book, but just having a quick look now it reads really well, either I read it wrong last year or got use to it, I would still recommend this with another book though as I feel it may include more than what is needed for a refresher

 

http://www.amazon.co.uk/Ivor-Hortons-Beginning-Visual-2012/dp/1118368088/ref=sr_1_1?s=books&ie=UTF8&qid=1375606617&sr=1-1&keywords=Beginning+Visual+C%2B%2B+2012 This contained enough to get started, though I must admit I missed out all sections after Ch10 simply because it is best to get separate books on other areas, it says VC++ but don't be put off from that its more using C++ in VS than anything, just make sure you don't pick C++/CLI

 

Eitherway its enough to understand the basics and get you started, it wont contain everything, but no book really does, reading one book results in buying 3 more on future areas, I think anything that claims it will make you a pro or teaches you something in 21 days is a load of a shit anyway. Languages are not meant to be learnt in 21 days, just practice a lot and get the experience, you'll get there eventually but just remember there is ALWAYS something to learn.

 

Oh and as for problem solving, or trying to understand something, you will always have a situation where you are pulling out your hair, stressed at why something isn't working or making sense, the worst thing you can do is quit thinking it only affects you, because EVERYONE goes through this over and over and over again, no matter how elite, pro or awesome they are. I have seen so many people quit feeling programming isn't for them due to not understanding something thinking it only confuses them and them only.

Edited by Dynamo_Maestro

Share this post


Link to post
Share on other sites

The great thing about C++ books is you know that you only need to read 5% of it to be as productive in C++ than any other language. The difficulty is knowing exactly which 5% to read ;)

 

If you have written your own vector class, then tbh that is a pretty good start. Remember, just because C++ has the STL doesn't mean you need to use it in designing your own classes. Other languages make do fine without it. If you can understand how to use std::vector (easier than C style arrays anyway), then most C++ game engines don't go much further than that.

 

As for exceptions, yeah these are quite useful, so just google some examples on how to use them and then have a fiddle with your favourite C++ compiler.

 

Perhaps don't be so hung up on the language (or scared off by the perceived complexity), start making some simple games and the rest will come to you naturally as you encounter and overcome issues.

Edited by Karsten_

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!