• Advertisement
Sign in to follow this  

Should beginners start with C++?

This topic is 4171 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
Quote:

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.


Thats still not the idea behind instant gratification. Its more about seeing tangiable results from your actions. Neither of us are saying you should be able to click and play your games and simply presto, learn programming. The idea is more, as you learn more, you see actual results.

Shrinks call it a positive re-enforcement loop. Basically, the goal is to always show the person how they are developing. In programming, especially C++ programming, you can write hundreds of lines of code to do something so simple as draw a picture on the screen. Where as in a different language, you could potentially type Picture.DrawToScreen(x,y). Which one is someone going to feel a greater sense of accomplishment from?

Thats the whole premise behind instant gratification.

Share this post


Link to post
Share on other sites
When we are talking about instant gratification, we mean that you don't have to type twenty or so lines of code just to display the text "Hello World!" (exageration maybe :P), but instead you can type 1 or 2 lines of code.

Share this post


Link to post
Share on other sites
Well, I think that the answer is 'yes'. Why? Because I began with C++, and I didn't have any trouble. In fact, I taught myself C++ when I was 12. The only time I even felt like it was complicated was with templates and exceptions.

After that, looking at other languages, concepts and syntax are a breeze. Knowing C++ allowed me to learn other languages with ease. I never felt frustrated because I had to type ten lines to print one, and as for never seeing a DOS prompt, I was a computer nerd before I turned to programming, so I was fine with that.

Really, though, I think it depends on the person. If you have patience, I would say C++. If not, I would say another language. Personally, I'm a patient person, so C++ was easy. If you're impatient, though, I could imagine being frustrated at the amount of work to print one line as a beginner.

Share this post


Link to post
Share on other sites
Interesting thoughts, personally I feel there is no language that make things easier for new programmers.

All new programmers must learn one important thing and that is how to solve a problem with the tools on hand be it Java, C++ or VB. They must also learn to not give up, learning to program is painful.

When I was still studying most of my friends simply give up on learning to program and went on to focus on networking or graphics. Only the hardcore ones went on to software engineering, maybe we just love to inflict pain on ourselves :)

So even if a newbie comes in tomorrow and talks about his plans on making a MMORPG, if he is determined enough to learn the neccessary skills and not give up when faced with some tough problems I believe he/she can make it. But does such a person really exist? I seriously doubt it, everyone wants to make a World of Warcraft by himself in a month.

In the end I believe it is the programmer and not the language he/she chooses that matters most.

Share this post


Link to post
Share on other sites
Hey guys.. ive actually been tryin to teach myself c++ for a month now. i took a vb course in high school and liked it. started making a few of my own progz. (some dumb ones like ones that calculate ur power level, etc..) c++ was hard to pick up but now i feel like im starting to understand it more and more. is it bad that im basically starting c++ or can i benefit from this?

im only saying this cuz "most likely" im going to full sail in november and i just want to get a head start. please no criticism unless its constructive.

Share this post


Link to post
Share on other sites
Quote:
Original post by cheech306
Hey guys.. ive actually been tryin to teach myself c++ for a month now. i took a vb course in high school and liked it. started making a few of my own progz. (some dumb ones like ones that calculate ur power level, etc..) c++ was hard to pick up but now i feel like im starting to understand it more and more. is it bad that im basically starting c++ or can i benefit from this?

im only saying this cuz "most likely" im going to full sail in november and i just want to get a head start. please no criticism unless its constructive.


Hehe, I have no idea why it would be bad that you start C++. If you feel you are starting to understand it more then this is the moment to cling on! C++ will definately benefit you although it may not be the best solution for everything. It basically all comes down to yourself. If you can't keep up with it you will likely move away from C++ for some time to use some simpler languages. Then again, if you're serious in learning C++ there is no reason why it'd be bad.

Share this post


Link to post
Share on other sites
Quote:
Original post by rogierpennink
Quote:
Original post by cheech306
Hey guys.. ive actually been tryin to teach myself c++ for a month now. i took a vb course in high school and liked it. started making a few of my own progz. (some dumb ones like ones that calculate ur power level, etc..) c++ was hard to pick up but now i feel like im starting to understand it more and more. is it bad that im basically starting c++ or can i benefit from this?

im only saying this cuz "most likely" im going to full sail in november and i just want to get a head start. please no criticism unless its constructive.


Hehe, I have no idea why it would be bad that you start C++. If you feel you are starting to understand it more then this is the moment to cling on! C++ will definately benefit you although it may not be the best solution for everything. It basically all comes down to yourself. If you can't keep up with it you will likely move away from C++ for some time to use some simpler languages. Then again, if you're serious in learning C++ there is no reason why it'd be bad.



Thanks.. I needed some motivation to get that extra push. Its been hard and annoying at times but hopefully this is where I break through.

Share this post


Link to post
Share on other sites
Hey,

To build up a little bit of credability.. I'm a professional systems technician and software engineer of a few years back, started programming ca 12 years ago.. Starting off with the simple languages ofcourse. I write in Java, Python, C#, VB, VB.NET, ActionScript (if any kind of ECMA actually counts as a programming language..), C, C++. And I know I'm missing a few in there.

The obvious issue with C++ is that there are a whole lot of ways to accomplish things, the wrong way. With a whole lot of legacy all built up in a kind of confusing way (I suppose), it may not be an absolutely adequate learning platform.
As for starting with an easier language.. It can be a good idea, sure, but the problem with alot of the easier languages that I've seen is that they're very limited in terms of game development. (To be fair I'm not really a games developer, but I've thrown a few glances at it in all the languages I know)
As for the Python example, it is a great language and the python console is absolutely great. But using a jit is pretty much always going to make your application slow down significantly when they get a bit bigger. It does work fine for the smaller games, and as such makes for a just fine starting-up platform, but is it really worth getting into the Python way of thinking if you're only using it to try to get through it and move over to C++? It does have the same logic, but moving between the two when you haven't programmed before seems fairly difficult considering the difference in semantics and just alot of how python and c++ work with memory handling and pointers. I don't know if it's worth it at the end if you don't plan on continuing with the language after a certain point.
Starting with C is a more, logical, approach I suppose. But I don't see the reasoning behind taking that approach. Learning to program in C compared to C++ basically only lets you learn in a just as difficult environment, while using less tehnically adequate solutions for your problems. It's true that the transition from C to C++ is easier, but I think learning C++ right off the bat would amount to just about the same time spent.. While letting you skip a second round of "Hello World" with exactly the same code as in C, just a different compiler.


@cheech306:
If you feel comfortable learning C++, by all means go for it. The only thing that's actually difficult with it is starting out. After you get into the way to write them, and get past all the pesky little bugs that come about when you've written things the wrong way, it's all fairly easy. Plus it does help in learning other languages along the way, since most new languages have borrowed a lot from C++.

Share this post


Link to post
Share on other sites
"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! :)" -Serapth

I would agree that instant gratification is a need for a lot of beginning programmers. I started out with 'Learn To Program BASIC', a BASIC interpereter, and got really into programming because of how easy it was to make interesting things like a drawing program (which I intended to use to make sprites for games). I probably would've never moved on except for the fact that the interpereter's shortcomings became apparent as my programs grew longer. So I decided I needed this thing called a 'compiler'. I couldn't find a BASIC compiler, but my parents knew of my search and so decided to get me a compiler. I ended up with a 'C programming starter kit' (also included C++). The first thing I did when I got that was look through the accompanying books for chapters on graphics. There was none!!! I guess I spent a couple months in disbelief as I waded through the books, learning everything I could about C, then C++, doing simple console programs and hoping sooner or later to get some knowledge of how to make a visually appealing application. I never found out how though, and ended up spending several years in my own programming 'dark age'.

Anyway, to answer your question, I don't think there is anything wrong with C++ as a beginner's language (what I read in the books was intelligible enough). I just think that the way it is introduced (or at least was introduced to me) is flawed. Beginner's C/C++ books spend all their time on arrays, pointers, classes, and the like, and seem to consider things like windows and graphics as topics too advanced for their audience. Or maybe it is because they are trying to keep programs portable. However, without the proper incentives for the budding programmer, their interest will wane, and they may even stop programming altogether. Fortunately for me, I kept looking for ways to get graphics working and eventually, with the help of a Windows Programming book, found some functions I could use. Now even my console program programming is more fun. I just wish that when I had been introduced to C/C++ it had been by someone who realized the importance of instant gratification for new programmers.

Share this post


Link to post
Share on other sites
To keep it short; there are pros and cons of both approaches.

Instant gratification fuels the interest but also hides the details; details which are absolutely essential. In my experience, few people who start off on Java ever really get to grips with string handling, pointers, or memory management when they move to C++, yet those languages are very similar. It seems like too much of a backwards step to start focusing on the details.

On the other hand, I started with BASIC and did reasonably well in time, but the BASIC of the time was quite bare-bones (no aggregate data types, no sprite rendering, etc) and you still needed a lot of low-level knowledge, and hence persistence.

I would never say C++ retards your ability, but it perhaps weeds out a larger number of beginners earlier in the process - beginners who might have otherwise got something useful out of DarkBasic, Flash/ActionScript, or Python, but probably never progressed much further. So I think it depends on how seriously the person is going to take it.

Share this post


Link to post
Share on other sites
personally i think BASIC is a good way to start. however i do think starting out with C would be a good way to get a hang of the programming concepts. IMO, however, i think it really depends on what you want to start programming. If you badly want to make games, then you should start out with DarkBasic, or any other port of BASIC. VB is very easy to learn, but i don't believe it is the language to go for if games are your idea. C or BASIC are good ways to start. And i do believe you should start out with C++ rather than Java like mentioned above.

Share this post


Link to post
Share on other sites
Quote:
Original post by lmb
personally i think BASIC is a good way to start. however i do think starting out with C would be a good way to get a hang of the programming concepts. IMO, however, i think it really depends on what you want to start programming. If you badly want to make games, then you should start out with DarkBasic, or any other port of BASIC. VB is very easy to learn, but i don't believe it is the language to go for if games are your idea. C or BASIC are good ways to start. And i do believe you should start out with C++ rather than Java like mentioned above.


Is there a reason for the anti java? C++ seems to be held up as a paragon of programming talent, but frankly, there are probrably more bad C++ programmers then good ones. The biggest selling point of C++ is the freedom it gives you, yet at that same time, that freedom can and often does lead to some horrible code. The enforced rigidity in C# or Java most likely leads to more mediocre to good programmers, then C++ does. Hell, the lack of memory management alone probrably accomplishes that.

I think the concept that learning on a managed language means that somehow down the road you just arent going to grok pointers and memory language just seems silly. If you are able to get your brain around it while learning programming, you should be able to do so even easier with a language or two under your belt.

Share this post


Link to post
Share on other sites
Quote:
Original post by Serapth
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! :)
You need to know the history too.

What about a decent hex editor? :D
Or learning more than one languages at the same time?

I got my instant gratification from level editors of different games and "cracking" games that had no protection(modifing art/config files/savegames), later from that I was able to write some low level code and knowing that I had the power and control over my pc.

[Edited by - ivarbug on September 20, 2006 10:09:22 AM]

Share this post


Link to post
Share on other sites
Just to throw in my 2c here, I programmed in BASIC for about 15 years before I learned C and I firmly believe that if I hadn't already had my conceptual understanding of variables, subroutines, control loops and so on, I would never have got beyond first steps in C before giving up.

That is just me though. I find it constantly awe-inspiring to see the projects that kids today are creating at ages where I was still writing text adventures.

Share this post


Link to post
Share on other sites
Quote:
Original post by ivarbug
Or learning more than one languages at the same time?


Personally I cant do that. To me its kinda like reading two novels at a time. Technically I can do it, but trying to keep the concepts straight after is a pain and I dont really enjoy the experience.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement