is it a bad idea to start with c++

Pages: 12
i started learning c++ last night and it said it was the hardest so i was wondering if i should start off on learning c++ with no programming experience or should learn other, simpler forms of c first. (my ambition is to program games)
Last edited on
jumbob1141 wrote:
i started learning c++ last night and it said it was the hardest


Did C++ tell you this or did someone on the forum? C++ is a very powerful language, but for a beginner I would not recommend it. While your ultimate goal to make games naturally would lead you to learn C++, it is even more important to learn some fundamentals of computer science while learning programming, not that you can't do so with C++... I recommend Python as a first language, but if you are ready for the challenge by all means jump into C++ :)
I wish c++ would talk to me : (..
C++ is the first programming language that I recently started learning on UNIX (I have no programming experience) and so far, I haven't found it too difficult to grasp the concepts.
Last edited on
You may find it easy, who knows. I certainly did, but as you progress in Object Oriented Programming, Pointers, Classes, templates, etc... it can be a bit confusing for a new programmer.
I started with C++. It's not as hard as it's made out to be as long as you don't mind using code you don't fully understand. Actually understanding the code takes a long time, but being able to write it isn't that hard.

Starting with C won't help you learn C++. If anything it will only make it harder to learn C++ because you'll have to "unlearn" a lot of things C will teach you.


If you want to make games, then just do it. I recommend getting a game lib like SFML. Installing it can be tricky, but once it's working it will make creating games pretty simple.

http://www.sfml-dev.org/ <-- get SFML
I started C++ with no programming experience (unless you count TI-Basic) and it was a breeze. It really depends on how your mind works but for me C++ is actually one of the easier languages.
but for me C++ is actually one of the easier languages

I wouldn't say that. C++ is probably one of the most complicated languages out there. I think that's a fact, not a matter of opinion.

That said, learning C++ isn't really hard, as long as you have time, motivation and quality learning material. Most people would recommend an easier language as the first one, but I think it's just fine to learn C++ first. It will certainly provide you with a much better understanding of how computers work than if you went straight to a higher level language.

As an advice, once you feel comfortable with C++, learn other languages, preferably quite different ones. The insight you get from learning other ways to express your thoughts is just priceless.
I would personally not recommend C++ as a beginner's language (try Java, Python or possibly C#), but I would also recommend you compare at least two languages with each other, and stick with whatever you like the most. I gave both Java and C++ a week each before I decided that I liked C++ more. That was years ago though, I dropped programming and picked up C++ again because that was what I remember enjoying the most.

Your ambition is to program games, and you can do that in a few ways. The game industry relies extensively on C++, but C++ mostly has its place with larger games that require an extra performance boost. You don't need C++ if you're going to program simpler 2D games. You can use oter programming languages for that. I know a programmer who claims that making small and fun flashgames is very easy with ActionScript, and a lot of people seem to enjoy using C#, especially with XNA.

Again, it depends on where in game development you want to be.

it will only make it harder to learn C++ because you'll have to "unlearn" a lot of things C will teach you.

I have the other opinion about this
I think C is part of the C++, you don't need to "unlearn" anything of C
what you should do is learning how to co-work with C
Learning C gets you started doing things you shouldn't do in C++. Like use char arrays, malloc, printf, macros, etc, etc.

C++ has superior substitutes to all those things that are easier to use and harder to screw up. You're better off just starting with C++.
I think that some of the POSIX libc has its place in c++. For example, regex.h is really useful for string processing, stdarg.h provides the only way to get variable arguments, and dirent.h allows you (with glibc, at least) to open a folder on any computer, without messy #ifdefs. In general, many things are possible with glibc that are not possible when sticking only to the standard c++ libraries. c++ does not have superior substitutes for these things.
Last edited on
@rocketboy9000
There are superior solutions to these, namely Boost.Regex and Boost.Filesystem, which are proper C++ solutions.
For cstdarg, variadic templates can be used in future with the coming C++ standard.
Last edited on
@rocketboy: If you're going to count glibc, then it's only fair to count boost - which Athar already mentioned.

Besides, you can still use glibc in C++.

And I can't think of a time where I've ever had to use variable arguments. That probably could be an example of something C teaches you that you'll probably have to unlearn for C++.
sometimes we still need the legacy functions of C
like stdio.h, in most of the cases, it is faster than C++ style
And I always stick to stdio.h when I have to do some image processing works

Besides, when std::string becomes a bottleneck of your code
you maybe need to consider about the char array

At many times C++ style are better than pure C
but sometimes we still need them
so I don't think we have to "unlearn" C but to discern the difference of C and C++

boost, loki or other open source libraries could be a big help
but many functions of them are not supported by the standard yet(C++0x please come out quickly)
Besides, C is far more easy than C++ to begin with
it means there are more people know C than C++
Start from C would no be a bad idea, but you have to know the difference between C and C++


stereoMatching wrote:
like stdio.h, in most of the cases, it is faster than C++ style


How do you figure that? That's completely untrue.

We've had discussions about this before on the forums. I could list dozens of reasons why iostream is faster and safer than cstdio.

Besides, when std::string becomes a bottleneck of your code
you maybe need to consider about the char array


There is no reason why std::string (when used properly) couldn't be just as fast as a char array.

so I don't think we have to "unlearn" C but to discern the difference of C and C++


It's more than just language details. C teaches an entirely different style of coding. Most of it is considered bad practice in C++.

C and C++ are very different languages and learning C does not really do much to help you to learn C++.

How do you figure that? That's completely untrue.

then you should vote your opinions to the author of more effective C++
iostream are type safe and extensible, but it has it own defects


There is no reason why std::string (when used properly) couldn't be just as fast as a char array.

if heap can faster than stack
if compare with dynamic char array, string should not suffer too many penalty
if so, then maybe we did something wrong


C teaches an entirely different style of coding. Most of it is considered bad practice in C++.

yet C is part of the C++
no one should state that they could control C++ but they can't handle C
besides, I don't think C should be considered as "bad" or "good" coding style
you need to choose what kind of coding style should be used at different time
Last edited on
then you should vote your opinions to the author of more effective C++


Maybe you're taking the statement out of context.

Can you post part of the book where he makes that claim? I'm interested to hear it.

if heap can faster than stack
if compare with dynamic char array, string should not suffer too many penalty


True. A char array on the stack would have a speed advantage. Touche.

no one should state that they could control C++ but they can't handle C


I disagree. You might learn C syntax but coding in C takes a completely different mindset.

IMO that's what you're not seeing. Yes C and C++ share syntax, but using the languages is done very differently. C++ is more than just "C with classes". Coding effectively in C++ takes a completely different mindset than coding effectively in C. And learning the mindset of one does not prepare you to learn the mindset of the other.

Good C coders can make terrible C++ coders and vice versa.

I don't think C should be considered as "bad" or "good" coding style


You're right. There's absolutely nothing wrong with coding in C ... when you're coding in C.

However when you're coding in C++ there are many things you just shouldn't do (or should avoid doing), even though they're perfectly normal and acceptable in C.
closed account (zb0S216C)
C++ is relatively easy to learn as long as you stick to the basics until you are ready to move on. A few of my friends started to learn C++ as well. My friends, however, rushed into C++ and found themselves knee-deep in complex templates, functions, nested loops, pre-processor macros and classes. Eventually they got discouraged and claimed it was "too hard to learn".

learning C++ is easy enough to learn but rushing into it can lead to bad coding style and very buggy code. Start small and work your way up.
I started with C++, and then learned the C standard library via the C++ headers that make them accessible. Maybe I'm a glutton for punishment, reinventing the wheel several times over, but I love C more than C++. And I REALLY started using C alone when I found sprintf/sscanf in <cstdio> (<stdio.h> in C) was much faster for me than using a std::stringstream from <sstream> when converting integers to/from strings several times over. There was a noticeable difference in execution speed for me.

However, that is not a case for learning C instead of C++ or before C++. It is merely a case for knowing what tools are available and what works best in a particular instance. Bear in mind this was also a few years ago; the machine I used was slower than computers now, and the C++ compiler I used has since improved.

I'd recommend starting with C++ simply because it is easier for beginners. Both C and C++ have their negative points (pointers and template hell, respectively), but as the creator of C++ would say: "C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off."
Last edited on
I didn't even give my opinion on the main question, and I still spawned an argument? I didn't mean to.
I guess I'm a born troll. Ah, to hell with it. My opinion on the main question is that it is crazy to begin programming with any compiled language. Both C++ and C are very unforgiving to human error, and their syntax is incredibly complex to boot. I recommend an interpreted language, like Perl.
I started with Perl, which is quite forgiving in its syntax, and has inbuilt strings, dynamic lists, and maps that take any type. Conversions between basic types are handled automatically, and with the inbuilt functions you can handle large data sets easily. Perl also has a database of awesome libraries which can be used. Perl allows both imperative and functional paradigms, and easily beats most languages out there when it comes to developing small programs to automatically perform menial tasks.
That's my .02 CAD on this.
Pages: 12