Jump to content
  • Advertisement
Sign in to follow this  
Theodore Fuhringer

Ok, I was wrong. C++ is hard.

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

My face is melting off... I've switched to Stephen Prata's "C++ Primer Plus" and I'm up to chapter 6, "Branching statements and logical operators". It seems clear enough when I read it, but doing the programming exercises is a whole different ball of wax. I just spent two hours doing two dinky little punk-ass console programs I could have done inside of five minutes with DarkBasic or BlitzBasic. My head feels like a pumpkin in a microwave. I so badly want some hard liquor right now. :D

Share this post


Link to post
Share on other sites
Advertisement
The more you become familiar with C++ the easier writing it will become. The other high level languages you mentioned will almost always be easier to accomplish simpler tasks much faster, so don't be surprised. Personally, IMHO (most likely every programmer will disagree with me on this) I would start off by using straight c, move to c++, so you can learn to enjoy what c++ has to offer and understand it much easier.

Share this post


Link to post
Share on other sites
that is how i felt at the beginning as well, or i guess for me, it was a feeling of OMG and this is sort-of exciting

if you really want to do this sort of thing, you will overcome your obstacles, i know that's a bit harsh, but for me that's what had to be done (so many times i felt like i didn't want to do it, now that i'm in the groove nuthin will stop me, cept school ^^)

good luck!!!

@codemonger: that is how i started, not on purpose granted, but still...

Share this post


Link to post
Share on other sites
How different is C to C++? I am learning C++ and I have seen a lot of C in some things I have been studying, so I understand that there is some difference.

Alternately, how difficult is it to learn C after learning C++?

Share this post


Link to post
Share on other sites
C and C++ are different. In C you design proceduraly while in C++ the design is usually much more object oriented that procedural. The syntax differences between C and C++ are few so it is easy to learn C once you know C++, but it is a different way of thinking.
Just learn C++ and forget about C.

Share this post


Link to post
Share on other sites
Quote:
Original post by Dhadson
How different is C to C++?


Quite different, go do some C++ then do some C89 (without extensions on) and see if your code compiles the first time round [wink]

They have slightly different common practices & idioms used in where some in C are bad habbits and should be avoided in C++.

Quote:
Original post by Dhadson
I am learning C++ and I have seen a lot of C in some things I have been studying, so I understand that there is some difference.


If you've seen more C then it would be harder to see the differences.

Quote:
Original post by Dhadson
Alternately, how difficult is it to learn C after learning C++?


It shouldn't be that diffcult, infact it might be better to learn C++ before C so you don't try to apply bad habbits in C++, bad habbits are hard to shake off you know [wink].

Quote:
Original post by vNistelrooy
In C you design proceduraly while in C++ the design is usually much more object oriented that procedural.


That is not really there differences, you can do procedural in C++, C++ isn't just pure OO either, you can do procedural, OO, generic, generative, even a form of functional programming (with library support). Not all C++ code is OO either.

Procedural C++ code (excluding C++ features not in C) will most likely not compile in C89, i've seen people fall for it so many times.

@Theodore Fuhringer yes C++ isn't a good beginners language.

[Edited by - snk_kid on August 24, 2005 2:38:39 PM]

Share this post


Link to post
Share on other sites
Just hang in there. If you stick with the language and give it a chance, it will become easier. One day you will write code at such a fast pace, beginners will just wonder what the heck is going on.

Share this post


Link to post
Share on other sites
Don't worry yourself too much, all it takes to get used to C++ is practise. It's a little different from many other languages in the level of OO, so takes a while to learn properly. Keep it up and you'll see good results.

Also check my "if all else fails" post here:

http://www.gamedev.net/community/forums/topic.asp?topic_id=333728

I found that book to be a reference where all others failed me, you might find it useful.

Share this post


Link to post
Share on other sites
Ok, now I remember why I'm sticking with C++.

I made a test program in Blitz and duplicated it in C++. The program prints "Hello" 1000 times.

I used exactly the same method in both languages, a for loop, to acheive the effect, the I measured how long the loop took.

Blitz3D = 284 milliseconds : C++ = 140 milliseconds.

'nuff said. Back to my book :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Theodore Fuhringer
It seems clear enough when I read it, but doing the programming exercises is a whole different ball of wax. I just spent two hours doing two dinky little punk-ass console programs I could have done inside of five minutes with DarkBasic or BlitzBasic.

That's not C++, it's programming. :)
Yeah, it takes some getting used to, but don't give up. Once you get your mind wrapped around this stuff, programming will be a breeze, no matter the language. :)

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!