Used old C++, Sudden feeling overwhelmed.

Started by
20 comments, last by doyleman77 10 years, 8 months ago

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.

Advertisement

Yes, you're going to to want to get a decent book on it. Actually, probably several books. There is a lot of C++ to learn, and no single book covers the entire language, with the exception of the language standard. Mind you, reading the standard is a lot like reading ... twilight.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

tumblr_lbkl59q4X61qa0uujo1_400.jpg

I don't remember the C++ standard being like that

"Most people think, great God will come from the sky, take away everything, and make everybody feel high" - Bob Marley

I'm surprised you didn't burn those. Actually, I'm surprised you bought more than one of them. In fact, I'm surprised you didn't ask for a refund after you bought the first book. That aside...

Its a lot like reading a legal document.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

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)?

The ones you listed are a great start. Also, check out Bruce Eckel's Thinking in C++. its free and available online from Bruce.

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.

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.

void hurrrrrrrr() {__asm sub [ebp+4],5;}

There are ten kinds of people in this world: those who understand binary and those who don't.

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.

Did you not take any algorithms / data structure courses?

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.

http://tinyurl.com/shewonyay - Thanks so much for those who voted on my GF's Competition Cosplay Entry for Cosplayzine. She won! I owe you all beers :)

Mutiny - Open-source C++ Unity re-implementation.
Defile of Eden 2 - FreeBSD and OpenBSD binaries of our latest game.

This topic is closed to new replies.

Advertisement