Jump to content
  • Advertisement
Sign in to follow this  

Should beginners start with C++?

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

Just a friendly conversation question. I know everyone is rabid about their language of choice, but thats not the question here. What im asking is, does starting with C++ actually retard a beginners learning ability? The more and more I read the things beginners are getting hung up on, the more and more I think the answer is yes. Myself, I started out pumping out BASIC code on 8bit computers. I mention this because it becomes relevant to my opinion later. After years of messing around with BASIC, and mindlessly PEEKing and POKEing, I decided to get real about learning to program ( no shot at basic here btw! ) and learned C. Lets just say, at this point in time I already had a pretty good understanding of a number of programming concepts from my BASIC days. Had I not, I would have given up ages ago. Plus, this was before the days of Windows. When Windows arrived on the scene, the barrier of entry for new programmers was massive! Its gotten better, but you still need to learn a ton of crap before even writing your first line of code. Now today, C++ has all the legacy crap C had for the most part. Even worse, when a new programmer comes into the world... what are they starting with? Console apps. My god, I imagine half the young new programmers in the world had never seen a dos prompt before! :) I know you need to walk before you can run, but again, how fast would you lose interest? Now, back to BASIC. At the time it was a terrible language. In my opinion, it still is ( no offence to the VB crowd, or especially the VB.net crowd, we are talking different languages ). But it offered me instant gratification, that lead me to learn more, then more, then more, then to be buried on such a brutal pile of spaghetti code that I actually wanted to learn things like properly structuring my code, good programming style, etc... Yet it all came down to one thing. Instant Gratification. I could pick up a book, read and digest a couple lines of code, and have my computer draw a line on the screen. Or make a beep, or loop around printing swear words at me. These were simpler times, so being told off by your computer was quite an accomplishment! :) I hold true to that today. I think the best languages for a new programmer are languages that give instant gratification. They do something, seconds later, they see a visual result. I also think that the best languages to learn on are the ones that minimize the barrier of entry. If they can make the compile/link cycle completely invisible, all the better! Finally, I think the best languages to learn with, are ones where you can literally type your code in and see it run. This is why I am so quick to recommend python to people. However, ActionScript or DarkBasic may be just as good of examples ( I have zero experience with each, so no comment from me ). Lastly, even with all this freedom, the language should teach concepts that are transferable to other "grown up" progamming languages. If I was just starting out, programming in the way the software world is, I think if I started with C++ I would have most likely given up. VB is a different story, but can lead to some seriously bad programming habits. C#, is a nice stepping stone to C++ and is a powerful language in its own right, which can lead to unnecisarry confusion to a beginner. Much the same is true with Java, but worse, it actually has some barriers in place that will make new users have to fight with their code. Yet again... I come back to python. Opinions? :)

Share this post


Link to post
Share on other sites
Advertisement
I agree with you 100%. The best languages for beginners are languages that you can pick up a book, read a few pges, type a couple lines of code, and have something shown on the screen. Personally, my suggestion for any beginner is VB. It's easy to learn, and can provide you with quick results, while you can still create reasonably complex programs with it. Plus, it makes it extremely easy to create nice-looking windows forms, while you have to use C++ for quite a long time to start using windows apps, in comparison.

Share this post


Link to post
Share on other sites
Assuming you can generalize all beginners I would tend to agree with your point of view. My first real introduction to programming was PHP and only after I ran into its limitations I started to appreciate C++.

Instant gratification is indeed the key in this 'debate'. Maybe there are specific cases where beginners do not care so much for this, but I think it's a fair observation that boring console programs often cause beginning programmers to quit their C++ aspirations for a while.

Having said that, however, I think there might be a cure to this, or at least, a way to make entrance to C++ easier. What if there was a library ( like the standard library ) that could act as a kind of a tutorial library? A library that'd grant the beginner some immediate visual results? With the number of libraries increasing each day I'm surprised there's not some kind of widely-accepted library like this. I think it's worth considering - the user would not have to know about the implementations of the easy to use methods, but he would learn the basics of using classes and methods and pointers etc. gradually by playing around with said library.

Anyway, that was just me and a stupid brainwave [grin]. I don't have much more to add, as I whole-heartedly agree that non-instant gratification puts off a lot of beginning programmers...

Share this post


Link to post
Share on other sites
It's all a matter of preference.

For me, I have to do things the way I want to, and figure things out on my own. I have to find out for myself why to use this reason or the next, because that way I know it is absolutely true.

In my opinion, I think you should start off with atleast C, learn it, be able to create a text adventure or similar in size console project. Then, learn C++ and OOP, and create a text adventure. Hopefully you will realize through it the importance of OOP.

In addition, when you go to learn a "simpler" language, or even another, such as Java, C#, or Python, it should be considerably easier as C++ is regarded as a more difficult language.

However, that is me. Others merely want to write their MMORPG or FPS immediatly. To tell you the truth, that's what I did in the very beginning. I started with Python and Panda3D/Soya3D. I didn't get any graphics showing in an hour or two of working with it over a few days worth, and so I dumped it. I then tried Blitz3D, and got some terrain up fast. I then looked at other projects, samples, and forum posts and added a movable and view-controlling camera, then a system to read a image file and place a tree or object wherever a certain color pixel was. This was pure instant gratification. I had all this up within about two to three months, but just a total of 5-6 programming hours.

Fortunatly, ironically, I came to realize that instant gratification was not the right way to go. I really wasn't learning to program, I was merely taking code and modifying it to suit my needs, and that sooner or later, I was going to be out of help, because the needs would be to advance and to complicated to simply steal code and modify a few ammounts.

Here I am a few months later, about to starting with SDL/Allegro with C++. I can now create a text adventure or other console programs or games with ease and fun. And I feel so much more accomplished than I was with my Blitz3D FPS. Not to mention this skill has carried over to multitudes of 100's in my Computer Science class, to College, to my job, and to learning other languages.

That's quite a bit more achievement than moving around a small piece of land and tree's, but not understanding alot of the lines of code you just wrote.

Share this post


Link to post
Share on other sites
Yes, I agree that it is definately not the best or at least a good choise to begin programming. Even the typical "Hello" world program is difficult to explain. There are no built-in functions in C++, so for that program you have to explain headers(#include <iostream>), functions(int main), namespaces(std:: or using namespace std), operators(>>) and let's not mention that the poor beginner will have no idea what 'cout' is supposed to mean. You must either explain all that or say 'don't worry, just type them and we'll explain them later'. In, say, Python it's just "Print 'hello world'". And just let me say that having an interactive interpreter is a *huge* advantage, since you can type simple lines of code and instantly see what they do, without having to compile a complete program. And this is my personal opinion, but I think that static, and most importantly non-inferred typing is an additional burden for the beginners.

Quote:

However, that is me. Others merely want to write their MMORPG or FPS immediatly. To tell you the truth, that's what I did in the very beginning. I started with Python and Panda3D/Soya3D. I didn't get any graphics showing in an hour or two of working with it over a few days worth, and so I dumped it. I then tried Blitz3D, and got some terrain up fast. I then looked at other projects, samples, and forum posts and added a movable and view-controlling camera, then a system to read a image file and place a tree or object wherever a certain color pixel was. This was pure instant gratification. I had all this up within about two to three months, but just a total of 5-6 programming hours.

Fortunatly, ironically, I came to realize that instant gratification was not the right way to go. I really wasn't learning to program, I was merely taking code and modifying it to suit my needs, and that sooner or later, I was going to be out of help, because the needs would be to advance and to complicated to simply steal code and modify a few ammounts.


That's not the 'instant gratification' we're talking about. There are no differences between C++ and other languages when it comes to 'stealing' code, in fact there are probably 50x more C++ source samples floating around the net, and it's just as easy to copy/paste them in your C++ editor as it is to do it in BlitzBasic/Python. Why did you indulged in copy/paste with Blitz and not with C++? What we're talking about is that higher level languages abstract several things so you can describe what you want to do(and of course, understand the commands you type) without getting too involved with details like 'what type should this variable be' or 'how large should I make my array'. That way, you learn to program but able to see the results more quickly because, frankly, when you program in C/C++ you do a bit of the compiler's work yourself. That's why there are so many cases where 'undefined behaviour' rises if you're not careful or just ignore a part of the huge C++ Standard.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ueneth Echil
In addition, when you go to learn a "simpler" language, or even another, such as Java, C#, or Python, it should be considerably easier as C++ is regarded as a more difficult language.


Isnt that just a matter of front end loading the learning curve? I mean, I agree, once you know C++, learning many other languages will be alot easier, but isnt that just because you have already gone through the learning curve? Would you not learn much faster in a language with a lower learning curve, then pick up something "hard" like C++ faster because the learning curve is lower? Keep in mind, im not talking against learning C++, Im talking against learning C++ first. And im being a hypocrite, as I basically learned C first myself, yet then, like I said, those were much simpler times.

Quote:

I then tried Blitz3D, and got some terrain up fast. I then looked at other projects, samples, and forum posts and added a movable and view-controlling camera, then a system to read a image file and place a tree or object wherever a certain color pixel was. This was pure instant gratification. I had all this up within about two to three months, but just a total of 5-6 programming hours.

Fortunatly, ironically, I came to realize that instant gratification was not the right way to go. I really wasn't learning to program, I was merely taking code and modifying it to suit my needs, and that sooner or later, I was going to be out of help, because the needs would be to advance and to complicated to simply steal code and modify a few ammounts.

Here I am a few months later, about to starting with SDL/Allegro with C++. I can now create a text adventure or other console programs or games with ease and fun. And I feel so much more accomplished than I was with my Blitz3D FPS. Not to mention this skill has carried over to multitudes of 100's in my Computer Science class, to College, to my job, and to learning other languages.

That's quite a bit more achievement than moving around a small piece of land and tree's, but not understanding alot of the lines of code you just wrote.


I have no experience with Blitz either, but I do have to ask a question. Did it not cement the basics of programming for you ( while being gratified ), or did you not even pick up the basics of program flow, conditional expressions, variables, etc? I just wonder if your Blitz experience actually helped you later on down the road.


Also, I didnt mention this elsewhere, im avidly anti cut and paste coding. Regardless to language, I think this is the worst way you can "learn". Don't get me wrong, once you know what your doing, cut and paste will become your best friend, but I think even by actually physically typing in someone elses code, you retain more then simply cut and pasting.

Share this post


Link to post
Share on other sites
Quote:
That's not the 'instant gratification' we're talking about. There are no differences between C++ and other languages when it comes to 'stealing' code, in fact there are probably 50x more C++ source samples floating around the net, and it's just as easy to copy/paste them in your C++ editor as it is to do it in BlitzBasic/Python. Why did you indulged in copy/paste with Blitz and not with C++? What we're talking about is that higher level languages abstract several things so you can describe what you want to do(and of course, understand the commands you type) without getting too involved with details like 'what type should this variable be' or 'how large should I make my array'. That way, you learn to program but able to see the results more quickly because, frankly, when you program in C/C++ you do a bit of the compiler's work yourself. That's why there are so many cases where 'undefined behaviour' rises if you're not careful or just ignore a part of the huge C++ Standard.


Well, I'd have to disagree. While I don't have the experience, I would assume that it takes more than 5 short lines of code to make a first-person-shooter-mouse-moved camera, and more complex.

Quote:

Isnt that just a matter of front end loading the learning curve? I mean, I agree, once you know C++, learning many other languages will be alot easier, but isnt that just because you have already gone through the learning curve? Would you not learn much faster in a language with a lower learning curve, then pick up something "hard" like C++ faster because the learning curve is lower? Keep in mind, im not talking against learning C++, Im talking against learning C++ first. And im being a hypocrite, as I basically learned C first myself, yet then, like I said, those were much simpler times.


You got me there, I didn't think of that. <slaps himself>

Quote:

I have no experience with Blitz either, but I do have to ask a question. Did it not cement the basics of programming for you ( while being gratified ), or did you not even pick up the basics of program flow, conditional expressions, variables, etc? I just wonder if your Blitz experience actually helped you later on down the road.


Well, not really. But I really already know them through common sense. If-then, else-if, else, integers, floats, objects.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!