Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Used old C++, Sudden feeling overwhelmed.


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
21 replies to this topic

#1 doyleman77   Members   -  Reputation: 366

Like
2Likes
Like

Posted 03 August 2013 - 08:19 PM

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.



Sponsor:

#2 Washu   Senior Moderators   -  Reputation: 6761

Like
5Likes
Like

Posted 03 August 2013 - 08:23 PM

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.
ScapeCode - Blog | SlimDX


#3 Paradigm Shifter   Crossbones+   -  Reputation: 5600

Like
11Likes
Like

Posted 03 August 2013 - 08:32 PM

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

#4 Washu   Senior Moderators   -  Reputation: 6761

Like
14Likes
Like

Posted 03 August 2013 - 08:36 PM

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.
ScapeCode - Blog | SlimDX


#5 doyleman77   Members   -  Reputation: 366

Like
0Likes
Like

Posted 03 August 2013 - 08:49 PM

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



#6 Washu   Senior Moderators   -  Reputation: 6761

Like
5Likes
Like

Posted 03 August 2013 - 09:00 PM

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.
ScapeCode - Blog | SlimDX


#7 Khatharr   Crossbones+   -  Reputation: 3876

Like
4Likes
Like

Posted 03 August 2013 - 10:08 PM

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.

#8 Memories are Better   Prime Members   -  Reputation: 769

Like
1Likes
Like

Posted 04 August 2013 - 03:16 AM


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, 04 August 2013 - 04:19 AM.


#9 nczempin   Members   -  Reputation: 108

Like
0Likes
Like

Posted 04 August 2013 - 04:41 AM

Did you not take any algorithms / data structure courses?



#10 Karsten_   Members   -  Reputation: 1780

Like
0Likes
Like

Posted 04 August 2013 - 05:51 AM

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_, 04 August 2013 - 05:54 AM.

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


#11 doyleman77   Members   -  Reputation: 366

Like
0Likes
Like

Posted 04 August 2013 - 06:26 AM

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

 

I downloaded the two volumes, thanks for the recommendation on Bruce's books.

 

 

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.

 

 

For as much as programmers need to divide and conquer, I am a bit ashamed to say I forgot I could take the same tactic against the language. Thanks for this advice.

 

 


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.

 

 

C++11 has a bit more abstraction than what I am used to, is really all. So much that I get lost and / or confused when I had glanced over some examples once I learned there was the new standard.

 

I appreciate the book recommendations, too. I'll toss them in a wishlist for myself. Maybe another birthday or christmas, another book.

 

Did you not take any algorithms / data structure courses?

 

Actually, I am set up for Data Structures and Algorithms 1 this semester, and Data structures and Algorithms 2 for next semester. I'm still in Uni, I had to leave for awhile because our state suffered a huge flood back in 2011 (north dakota). So I will be tackling this very soon.

 

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.

 

I can get the gist of exception handling down, but I don't see a practical use... What was wrong with return values to handle errors?

Maybe I'm thinking about them all wrong...

 

 

Thanks all for the encouragement, and advice. I'll take a crack at this.


Edited by doyleman77, 04 August 2013 - 06:32 AM.


#12 Yrjö P.   Crossbones+   -  Reputation: 1416

Like
2Likes
Like

Posted 04 August 2013 - 03:10 PM

I can get the gist of exception handling down, but I don't see a practical use... What was wrong with return values to handle errors?

Unsafe as default: if you forget to check a return value, your program may fail subtly and silently (whereas exceptions without handling do the right thing, kill the program immediately and in a way that is easy to debug).

The conditional logic needed to shuffle the errors around makes the code more complicated, quite possibly introduces new bugs, and obscures the normal program flow. The code becomes brittle, hard to read, change or reuse. Clean functional or generic code becomes pretty much impossible.

The differences become apparent even with a trivial example. Suppose we have functions with these prototypes:
string getFilenameWithDialog();
stream openFile(string);
object loadGameObject(const stream&);
Let's say getFilenameWithDialog can fail, openFile can fail in three different ways, and loadGameObject can fail in two different ways. And let's say we want to write a function that uses them, but passes the errors to whoever calls it to handle:
object loadUserObject() {
    return loadGameObject(openFile(getFilenameDialog()));
}
With exceptions, that's it, there's no error handling to write at all. Consider how you'd have to define the functions in the first place, and what loadUserObject implementation would look like, if you tried to use return value error handling. (It will get much worse than that when code gets more complex than this trivial example.)

#13 doyleman77   Members   -  Reputation: 366

Like
0Likes
Like

Posted 04 August 2013 - 04:01 PM

 

I can get the gist of exception handling down, but I don't see a practical use... What was wrong with return values to handle errors?

Unsafe as default: if you forget to check a return value, your program may fail subtly and silently (whereas exceptions without handling do the right thing, kill the program immediately and in a way that is easy to debug).

The conditional logic needed to shuffle the errors around makes the code more complicated, quite possibly introduces new bugs, and obscures the normal program flow. The code becomes brittle, hard to read, change or reuse. Clean functional or generic code becomes pretty much impossible.

The differences become apparent even with a trivial example. Suppose we have functions with these prototypes:
string getFilenameWithDialog();
stream openFile(string);
object loadGameObject(const stream&);
Let's say getFilenameWithDialog can fail, openFile can fail in three different ways, and loadGameObject can fail in two different ways. And let's say we want to write a function that uses them, but passes the errors to whoever calls it to handle:
object loadUserObject() {
    return loadGameObject(openFile(getFilenameDialog()));
}
With exceptions, that's it, there's no error handling to write at all. Consider how you'd have to define the functions in the first place, and what loadUserObject implementation would look like, if you tried to use return value error handling. (It will get much worse than that when code gets more complex than this trivial example.)

 

 

 

I see where this can get hairy, after several different return type functions calling one after another. I'll look into exception handling first, before looking into templates, raii/stl, and the new c++11 features like auto. thanks!



#14 Bregma   Crossbones+   -  Reputation: 6063

Like
1Likes
Like

Posted 04 August 2013 - 04:11 PM


I can get the gist of exception handling down, but I don't see a practical use... What was wrong with return values to handle errors?

I really strongly recommend getting a copy of "The C++ Programming Language" by Stroustrup.  He explains why and when you would make such a choice, and the relative advantages and disadvantages.  He also points out it's OK to program using "C with Classes."  You need to own a copy of that book, it's like the bible only without all the begats (that's in a separate book by Stroustrup, the "Design and Evolution of C++").

 

Also, Guru of the Week.


Edited by Bregma, 04 August 2013 - 04:12 PM.

Stephen M. Webb
Professional Free Software Developer

#15 Matt-D   Crossbones+   -  Reputation: 1554

Like
7Likes
Like

Posted 04 August 2013 - 07:02 PM

The books you've chosen are quite good!

 

Regarding the reading order, I'd advise the following:

0. I'd start with "C++ Primer", 5th Edition by Stanley B. Lippman, Josée LaJoie, Barbara E. Moo

// http://www.informit.com/store/c-plus-plus-primer-9780321714114

This will get you up to speed with modern C++11, including giving you a very good, thorough introduction both to the core language and to the standard library.

 

1. Then, consider "The C++ Standard Library", 2nd Edition" by Nicolai M. Josuttis

// http://www.cppstdlib.com/

This will give you more practice with the standard library and drill deeper into more details.

 

2. If you still feel like a more complete, reference-style overview of the language and the library, the way to go is "The C++ Programming Language", 4th Edition (TC++PL4) by Bjarne Stroustrup

// http://www.stroustrup.com/4th.html

// http://www.informit.com/store/c-plus-plus-programming-language-9780321563842

IMHO it's not the first book to read if you're feeling "overwhelmed". Very good for the "big picture" understanding ("how does it all tie together").

 

That being said, the drafts of the first part of TC++PL4, known as "A Tour of C++", are available for free, so you may as well add these to your reading list:

http://isocpp.org/tour

 

Note that every single book in the above list is modern C++11. I would NOT advise to start with Eckel's "Thinking in C++" -- while it was actually a good book in its time (there are a lot of poor books on C++ even on the first day of their release -- Eckel's books were not among them, they were actually pretty good), it will not get you up to speed with modern best practices. You may consider it as a future reading list TODO item, but definitely not the one to start with.

 

BTW, Scott Meyers is currently working on "Effective C++11/14" (so you may want to consider ordering these, should be out by the time you're done with the others):

http://scottmeyers.blogspot.com/2013/08/two-videos-coming-many-videos-past.html

There's also link to videos by Scott Meyers there -- http://www.aristeia.com/videos.html

 

This reminds me of Channel 9 :-)

http://channel9.msdn.com/Tags/c++

 

I can DEFINITELY recommend videos by Stephan T. Lavavej (yes, his initials really are STL, how awesome is that ;]) to everyone -- 100% AWESOME!

http://channel9.msdn.com/Tags/stephan-t-lavavej

I may sound too positive here ;-), but it's so rare to find high quality videos on C++ on the Internet, that it makes the exceptions all the more praiseworthy :-)

 

In particular, you just HAVE to watch the following series:

- C9 Lectures: Stephan T. Lavavej - Standard Template Library (STL): http://channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-

- C9 Lectures: Stephan T. Lavavej - Advanced STL: http://channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Advanced-STL

- C9 Lectures: Stephan T. Lavavej - Core C++: http://channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Core-C-

 

In fact, it may be a good idea to start watching the STL series alongside reading a book #0 on these topics, this will give you even more examples/details/explanation.

(For instance, right there in the first lecture he talks about capacity-vs-size in std::vector and the practical allocation details, which is pretty good when trying to understand what to expect and what not to worry about).

// Perhaps do it after doing the exercises in the respective chapter(s), though -- note that these videos are not introductory themselves.

 

Herb Sutter is also rewriting the Guru of the Week (GotW) series for C++11/14:

http://herbsutter.com/gotw/

 

See also "The Definitive C++ Book Guide and List": http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list

During learning, you may also find cppreference.com helpful: http://en.cppreference.com/w/

// Note "6 June 2013: The C++03 and C++11 standard libraries have been completely documented."

// There are plenty of not-so-maintained references for C++ on-line, so it's important to be picky ;-)

 

// EDIT: I've also noticed you've asked about the exceptions, etc.

// While unfortunately it hasn't been updated to C++11 yet, C++ FAQ is a good place to reach for whenever you have questions like this, if anything to get additional information to form an informed perspective: http://www.parashift.com/c++-faq/

 

TL;DR:

http://herbsutter.com/elements-of-modern-c-style/

http://klmr.me/slides/modern-cpp/

// OK, this is tongue in cheek, seriously, go read the books ;D


Edited by Matt-D, 04 August 2013 - 07:31 PM.


#16 Birokrat   Members   -  Reputation: 103

Like
0Likes
Like

Posted 05 August 2013 - 01:39 PM

I'm not a professional in C++ but the best book I have ever stumbled upon is this one:

 

C++ Programming From Problem Analysis to Program Design [5th Edition]  



#17 Servant of the Lord   Crossbones+   -  Reputation: 25233

Like
4Likes
Like

Posted 05 August 2013 - 03:13 PM

It sounds like:
A) You already know the core features of C++ language.
B) You don't know good software architecture practices.
C) You aren't yet comfortable with templates.
D) You aren't yet familiar with C++11's new features.

That's good. Now you know what you do know, and what you need improvement on. That gives focus.
There'll always be subjects you know and don't know, and being able to identify areas that need growth is great.

Definitely not the end of the world!

 

Also, you don't need to spend a fortune on books right out the door. Pick up a few (2-3) and supplement them with online resources, and after consuming it, you'll be in a much better position to decide what others to pick up, based on what areas you still need improvement in.

 

If you already feel overwhelmed, putting a stack of a dozen heavy tomes in front of you at one time might make you feel even more overwhelmed.


Edited by Servant of the Lord, 05 August 2013 - 03:14 PM.

It's perfectly fine to abbreviate my username to 'Servant' rather than copy+pasting it all the time.
All glory be to the Man at the right hand... On David's throne the King will reign, and the Government will rest upon His shoulders. All the earth will see the salvation of God.
Of Stranger Flames - [indie turn-based rpg set in a para-historical French colony] | Indie RPG development journal | [Fly with me on Twitter


#18 Yrjö P.   Crossbones+   -  Reputation: 1416

Like
3Likes
Like

Posted 05 August 2013 - 04:42 PM

I see where this can get hairy, after several different return type functions calling one after another. I'll look into exception handling first, before looking into templates, raii/stl, and the new c++11 features like auto. thanks!

I would strongly recommend rearranging that list and starting from STL. Stop using C-style arrays and use std::vector instead. You don't have to understand a thing about templates for basic use of STL containers. As soon as you create a vector, like a "vector<int>" or "vector<SomeClass>", it's just a class that happens to have angle brackets in its name.

One natural follow-up of adopting STL containers is using auto. For instance, consider the line "std::vector<MyClass> vec = std::vector<MyClass>(10);". It's clear what type is being assigned; why would we type it twice? "auto vec = std::vector<MyClass>(10);" does the same thing. All "auto" means is "hey compiler, you know what type this is".

For a while, don't use raw pointers at all. Go cold turkey. No "new", no "delete", no pointers in function arguments. If there's an asterisk (*) anywhere in the code, it's either multiplication or a STL iterator access. You can use references, put things inside vectors, put vectors inside vectors, or do something else that doesn't involve a pointer. From that 100% pointer-free style it's easy to dial back slightly and use pointers in places where they legitimately make sense, like building your own data structures, ending up with nice clean code that is maybe 99% or 98% pointer-free (unless it's low level by necessity).

#19 superman3275   Crossbones+   -  Reputation: 2061

Like
0Likes
Like

Posted 05 August 2013 - 09:20 PM

I went through this exact same phase of mind. Look a my blog, I posted about it a lot during that time.

As a side note, I've got a new computer and can finally get active again.

I'm a game programmer and computer science ninja ph34r.png!

Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!

 

Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!

Want to ask about Python, Flask, wxPython, Pygame, C++, HTML5, CSS3, Javascript, jQuery, C++, Vimscript, SFML 1.6 / 2.0, or anything else? Recruiting for a game development team and need a passionate programmer? Just want to talk about programming? Email me here:

hobohm.business@gmail.com

or Personal-Message me on here smile.png!


#20 Ravyne   GDNet+   -  Reputation: 10819

Like
1Likes
Like

Posted 06 August 2013 - 07:43 PM

The way I see it, you're kind of in luck. Nearly all of the must-have books have recently been updated to C++11--Lippman et al's C++ Primer 5th Ed, Bjarne's The C++ Programming Language, and Josuttis' The C++ Standard Library: A Tutorial and Reference being the first three you probably want--Meyers' Effective C++ is not yet updated, and as a book is probably most-useful when you have a better understanding of C++11, along with the standard library; depending on how he revisits the content from the 2nd Ed, the current 2nd Ed may or may not remain a valuable resource. Avoid "More Effective C++" it hasn't yet gotten a 2nd Ed, and it was published between C++96 and C++03, so its pretty outdated (there are some gems of info inside, so read it if you can borrow a copy, just don't waste your money on it at this juncture).

 

If you approach C++11 with a clean slate (that is, leverage your experience with the syntax, but try to forget your "old way" of doing things), then you'll have a good time. While C++ is larger and more intimidating, it actually is a great stride towards writing correct code that's easier to maintain if you use the tools properly, and the C++ standard library has been expanded upon with many helpful classes, like regex and smart pointers, that you previously had to build or find from a third party.

 

Good luck.


throw table_exception("(ノ ゜Д゜)ノ ︵ ┻━┻");





Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS