Jump to content
  • Advertisement
Sign in to follow this  
Spaz Aholic

I just can't understand C++

This topic is 4609 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

I'm going to have to agree with everyone here. For the past... let's call it a while, cause it shames me to admit how long, I've been doing my darndest to teach myself how to program, starting with C++. For a long time, I just couldn't remember things, so to do even the most rudimentary of operations I would refer back to my books and tutorials (still am to this date to try and figure out how to do my binary file operations that I want). I'm by absolutely no means even close to a "decent" C++ programmer at this point, but I did something interesting recently.

I picked up a book about coding games in Python, Ruby and Lua, aptly titled Game Programming in Python, Ruby and Lua [Premier Press, Tom Gutschmidt w/ editting by Andre LaMothe] and something magical happened... I was reading the section teaching me how to draw graphics and whatnot in Python, and suddenly things started clicking. I understood what the author was doing in Python based on everything I had read about C++, even if I had not grasped how to implement it myself. So far (I'm still working my way through the book) it seems that every new thing I read about for Python makes things I was trying to wrap my head around in C++ make all the more sense. I can see how they work inherently.

Sorry if I come off as somewhat dumbstruck by the marvel of it all, but I am. I'm not sure I would necessarily recommend Python over C++, as the two languages are quite dissimilar and there are large differences in how certain structures and procedures are called and used in code, but I can definitely attest that learning one language will make the subsequent languages you try to learn easier. As such, Python may be a good thing to look into.

Best of luck, something to chew on,

Vopisk

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
I suggest learning Python. Then you will learn the basic programming concepts which will help you understand C++

Share this post


Link to post
Share on other sites
Quote:
Original post by Vopisk
I picked up a book about coding games in Python, Ruby and Lua, aptly titled Game Programming in Python, Ruby and Lua [Premier Press, Tom Gutschmidt w/ editting by Andre LaMothe] and something magical happened... I was reading the section teaching me how to draw graphics and whatnot in Python, and suddenly things started clicking. I understood what the author was doing in Python based on everything I had read about C++, even if I had not grasped how to implement it myself. So far (I'm still working my way through the book) it seems that every new thing I read about for Python makes things I was trying to wrap my head around in C++ make all the more sense. I can see how they work inherently.


Well, first, I'll just say, I'd personally avoid anything written/edited by LaMothe. But that's just me. :)
Other than that, yep, that's pretty much how "it" happens. You just keep reading, tackling the problem from different angles (maybe by reading different books/tutorials, or in your case, by reading about a different language entirely) and sooner or later, it'll all start to click into place.
Can take a while for that to really happen, but it's hard to really program until you get this understanding. (For me, at least. Some people seem perfectly able to just copy code from tutorials, but I want to understand what I'm doing too)

Anyway, there's one very good point here. You've clearly illustrated why people shouldn't be so hung up on C++. There are plenty of other languages, and what you learn in one language *will* carry over and help you in other languages. Learning Python is a good start to learning C++, and vice versa.
If you find C++ hard going, look at another, easier language instead. That's not "giving up", it's just trying to learn.

Share this post


Link to post
Share on other sites
Yea, as other people have said a book will probably be your best bet. Go to the store and look around at them, check the "Who is this book for" section, to see if its for an absolute beginer, and look through the book to see if it has alot of code examples, some books will spend pages and pages on a concept, and it's really easiest to understand to see it at work (and with saying that, it helps if you type in all the examples by hand and understand what you are typing while typeing it). And don't worry to much about if you aren't fully getting it, just keep reading and eventualy it will all fit togather, and if you get to far in and still aren't getting the basics then just ask on these forums, or ask someone who knows programing.


And you could learn another language first, but it isn't impossible to learn c++ as your first language, if you do pick another language then you should concentrate on a language that will be usefull for other things you like to do, if your just learning it to get to c++ it might be a bit harder to learn then just jumping into c++. For example if you want to do alot of simple windows apps then C# or visual basic might be your best choice, if you want to make web pages the php or C# will be helpful (both of which are very similar to c++).

Share this post


Link to post
Share on other sites
Quote:
Original post by Spoonbender
Well, first, I'll just say, I'd personally avoid anything written/edited by LaMothe. But that's just me. :)


I am sorry if i am being dense, but your coment regarding LaMothe is not the first one i have seen, there are a few things like that on several other forums. In no spirit to start a flame war, just really curious, why do you think that? i mean, isnt the guy suposed to be some kind of guru, and has written a lot of game programming books and has some hardware projects too. So, could you elavorate?

Thanks in advance.

Luis R. Rojas

Share this post


Link to post
Share on other sites
Well, you wrote you're stuck with standard "hello word" program, right?
I can tell you something about how i started learning c++. I just made hello word program basing on a tutorial and then started playing wirh it. For example: I've changed the text printed to screen and added some more "cout" commands.
Then i tried to add a variable printed inside text, then i tried making manual input of this variable, then i read tutorial about fuctions and tried to apply them somehow and so on. Then after some time i suddenly came to conclusion: "Hey! i can handle functions, structures, pointers and classes pretty well!" I haven't even spotted when that happened.

So if i can give you a piece of advice: don't rush, and if you see a piece of code you don't understand don't stare and think for hours but change something in it and see what happens.

Share this post


Link to post
Share on other sites
Quote:
Original post by lrojas
Quote:
Original post by Spoonbender
Well, first, I'll just say, I'd personally avoid anything written/edited by LaMothe. But that's just me. :)


I am sorry if i am being dense, but your coment regarding LaMothe is not the first one i have seen, there are a few things like that on several other forums. In no spirit to start a flame war, just really curious, why do you think that? i mean, isnt the guy suposed to be some kind of guru, and has written a lot of game programming books and has some hardware projects too. So, could you elavorate?

Thanks in advance.

Luis R. Rojas


LaMothe is a fine writer, but a poor programmer. Or at least he's an antiquated programmer. His books are entertaining, and he explains things clearly and concisely for beginners. Unfortunately, what his books discuss are mostly things that no modern programmer has to do for themselves (loading bitmaps, manually blitting them and swapping buffers). Further, the actual code examples are fraught with error, poor style, outright lies, and software design resembling a train wreck.

They are the pinnacle of cash grab publishing.

Share this post


Link to post
Share on other sites
I had that same problem and i decided to go into a simpler language so i went to C
so i can understand C procedual to go to C++ OOP.

Share this post


Link to post
Share on other sites
Quote:
Original post by Vopisk
I'm going to have to agree with everyone here. For the past... let's call it a while, cause it shames me to admit how long, I've been doing my darndest to teach myself how to program, starting with C++. For a long time, I just couldn't remember things, so to do even the most rudimentary of operations I would refer back to my books and tutorials (still am to this date to try and figure out how to do my binary file operations that I want). I'm by absolutely no means even close to a "decent" C++ programmer at this point, but I did something interesting recently.

I picked up a book about coding games in Python, Ruby and Lua, aptly titled Game Programming in Python, Ruby and Lua [Premier Press, Tom Gutschmidt w/ editting by Andre LaMothe] and something magical happened... I was reading the section teaching me how to draw graphics and whatnot in Python, and suddenly things started clicking. I understood what the author was doing in Python based on everything I had read about C++, even if I had not grasped how to implement it myself. So far (I'm still working my way through the book) it seems that every new thing I read about for Python makes things I was trying to wrap my head around in C++ make all the more sense. I can see how they work inherently.

Sorry if I come off as somewhat dumbstruck by the marvel of it all, but I am. I'm not sure I would necessarily recommend Python over C++, as the two languages are quite dissimilar and there are large differences in how certain structures and procedures are called and used in code, but I can definitely attest that learning one language will make the subsequent languages you try to learn easier. As such, Python may be a good thing to look into.

Best of luck, something to chew on,

Vopisk

That's my only complaint about LaMothe's book (WGP for Dummies). He throws code and doesn't explain where it came from or why/how it does what it does. Thank goodness for GameDev [smile]

Share this post


Link to post
Share on other sites
Look at it this way...once you know C++, the process is done.

As languages go (and this is from someone who started with Visual Basic--NOT ADVISED AT ALL, by the way), C++ is surprisingly clean. It's flexible (in most cases) and reasonably "clean." As for learning it, there's the effective, easy way to do it, and then there's the hard way.

Easy way:

Go here. Get Thinking in C++, Volume One and its accompanying Volume Two. Print it out if you can (highly recommended, it makes it a lot easier to internalize--at least, I think so). And read Volume One.

And read it again.

And read it again.

Bruce Eckel may very well be the best author I've ever seen when it comes to explaining C++. It's a far, far easier way to learn C++ than to go looking at websites that may or may not have a clue.

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!