C++ as first language

Apple iJuice

Beta member
Messages
5
Hey everyone, I'll be starting my first semester at a local technical college this fall majoring in electronics and computer engineering technology. Part of this includes learning C++. I'm curious as to the learning curve of learning C++ as a first language as I have absolutely no programming experience. I've read that most people like to start with Python (for reasons that escape me at the moment) much like a beginner guitarist learns Smoke On The Water as one of their first songs. Any knowledge or advice you can impart would be much appreciated, thanks.
 
C++ is a monstrous language with a steep learning curve - hence it's really relatively unsuitable as a beginners language. Sorry to be blunt, but that's just the way I see it!

That doesn't mean that you *can't* learn programming starting with C++, far from it. Many great programmers have started learning this way. It just means that you'll need to put a lot of effort in and bog yourself down with a lot more internal details of the machine than if you'd started with something like Python. Memory management is the key one - in C++ you're expected to do it all yourself. In more modern languages it's done for you automatically.
 
Ah, I'd figured as much. There was a time where I had an interest in programming enough to attempt to teach myself Python, but I found it difficult at the time because I couldn't find any comprehensive guides.

Now I know programming takes a lot of time, practice and patience, therefore I'm working with a small window of time. However, is there anything from now until September I can do to gain a better understanding of programming as a whole? As well as something I could do to, lower the curve per se.
 
Last edited:
At my college they use C++ in the intro courses and it seems fine. As long as you don't try to jump in to really complicated aspects right at the start, I'd say it's not much more difficult than other languages.

I may not be the right person to answer though because I learned the basics on my own before college. I learned using a language called Liberty BASIC (which has a free version called Just BASIC) which is meant to be an easy language. I wouldn't recommend it for big projects (you can't even include other source files, so everything has to be in one file) but it's great for learning the basics.
Since you said you know nothing about programming, I'd recommend trying to learn some of the basics before you start class (either using Just BASIC or something else, maybe even something like Javascript or Python) because then you'll be somewhat familiar with the concepts.
 
C++ is a monstrous language with a steep learning curve - hence it's really relatively unsuitable as a beginners language. Sorry to be blunt, but that's just the way I see it!
I agree, but I'm not sure what a good beginner language would be...

for a complete beginner EVERY language has a big learning curve. it really depends on what you're trying to accomplish.

when talking about college, the difficulty of a language really depends on the skill of the teacher.

It just means that you'll need to put a lot of effort in and bog yourself down with a lot more internal details of the machine than if you'd started with something like Python. Memory management is the key one - in C++ you're expected to do it all yourself. In more modern languages it's done for you automatically.
I think that there may be a reason for that though...
majoring in electronics and computer engineering technology.
when talking about electronics, often times there is no automatic memory management going on for you, I agree that in most modern languages there is no need to worry about memory management, but this is not the only approach, some people necessarily have to be worried about memory management.

At my college they use C++ in the intro courses and it seems fine. As long as you don't try to jump in to really complicated aspects right at the start, I'd say it's not much more difficult than other languages.

The skill of the teacher will depend on how difficult things are.

If you've literally no exposure to programming at all. then as a primer I'd suggest that you start by looking at a language like BYOB, it's not going to teach you programming, but it is going to teach you about laying out a program, logical progression, making decisions and loops etc.

if you're already comfortable with these ideas then I'd suggest getting a copy of something like C++ for dummies and going through the book that should give you a comfortable introduction to the language.

There are very few on-line resources that give a good introduction to complex languages, they all assume that you know how and why things are going on, mostly because -as berry pointed out above, complex languages don't make good starting points.
 
when talking about electronics, often times there is no automatic memory management going on for you, I agree that in most modern languages there is no need to worry about memory management, but this is not the only approach, some people necessarily have to be worried about memory management.
Sure thing, completely agree - but it's a historical reason. If people want to do micro controller programming then I completely agree it's a necessity (though I wonder whether that might even change with the introduction of ever more popular and powerful ARM devices.)

The skill of the teacher will depend on how difficult things are.
Definitely. But equally as importantly (I believe anyway) can be the tools that they use, in fact these two things (teacher and tool) working together can provide a great basis and a great mental model on which the student can build, or a poor one that will break down at some point.

I've always recommended Java (as you know) as a beginners language because it's a "real", well-used language with good tools (such as BlueJ / Greenfoot and others) specifically tailored to the beginner, and provides many "modern" easy features such as auto GC. I'm not sure *many* other languages fall into that category, though it could be sensibly argued some do. I'd say that C++ is a bad beginner language not just because of the heaps of memory management (bad pun intended) it puts on you, but because the adequate tools simply aren't there. Although there are some that would argue this is a good thing, and everyone should start with GCC and vim from basic principles I'm not so sure - I think this just leads to frustration and a high failure rate for all but the most dedicated. I'd agree that something like Scratch or BYOB is good for teaching logical progression and the like, and for that reason I'd recommend it for children or people of a young age - but I'm not sure I'd recommend it as a beginning step for adults that want to start learning, unless perhaps they're really not from a computing background and heavily struggle with the idea of logical progression. Even then, I don't think I'd use it with them for long.

Of course, all this assumes that it's someone who wants to start learning "seriously" - if it's someone who just wants to learn Mindstorms to drive RCX robots around, then so be it - let them have fun however they choose!
 
I learned using a language called Liberty BASIC (which has a free version called Just BASIC) which is meant to be an easy language. I wouldn't recommend it for big projects (you can't even include other source files, so everything has to be in one file) but it's great for learning the basics.

If you've literally no exposure to programming at all. then as a primer I'd suggest that you start by looking at a language like BYOB, it's not going to teach you programming, but it is going to teach you about laying out a program, logical progression, making decisions and loops etc.

if you're already comfortable with these ideas then I'd suggest getting a copy of something like C++ for dummies and going through the book that should give you a comfortable introduction to the language.

Thank you everyone, for the input. I will try to make the best of these resources. As stated, it seems like I'd be banking on the integrity of the class as well as the dexterity of the teacher and his/her tools to make for a viable learning experience. I don't want to risk going in completely in the dark and having no foundation to go off of.

As Root made clear, I would want to more so focus on the logic and concepts behind it before actually putting it to practice.

Of course, all this assumes that it's someone who wants to start learning "seriously" - if it's someone who just wants to learn Mindstorms to drive RCX robots around, then so be it - let them have fun however they choose!

This is definitely something I want to take seriously. I'll probably look into those robots after some time though...
 
VI and GCC?

in my day you got a print out of op-codes and a pen...

(actually that's serious and formed a large part of the A-Level electronics exam. -Q1, here's some op codes make a program that does this. Q2, here's a program, (in hex) tell us what it does). pen paper timed exam...

(there might be someone older than me that says in their day all they had was card stock and a hole punch.)


I do agree with you...

if you are a child, or are absolutely new to programming, they BYOB/scratch is a good start.

if you are reasonably competent at the basics and just want to write programs, then Java is a great choice.

if you need to learn programming, and there is a chance that it might lead to on chip programming, (programmable interface) then you're really looking at C, C++ or Assembler, (this may change as more powerful chips may run embedded Java interpreters, (though someone will still need to be able to code that interpretor!) but with great power comes great responsibility, you;re going to have to work out some things yourself that other program languages just do for you.

if you just want to make a form to display buttons and do something quick and easy, then visual basic.

If you don't need a visual output, but do need a quick and easy way to dump computer information to a text file the VBscript.


as berry alluded to, Vi and GCC is not the best start point. sure it's free, so has a reduced financial barrier to entry.
but you need to learn how to actually use the tools. a proper IDE might cost you some money, but when you're starting out being able to just press a button and have it all just work is good.
 
I completely agree with what Berry and root have said (there are a number of existing threads along very similar lines).

One additional detail which I would add, speaking as someone who self-taught C++ for second year university modules as Java was the 'standard' language but C++ was needed for graphics work, is a slightly mirrored approach to that mentioned previously. (Note I am not saying this is better/worse, but its a different take on the problem)

Instead of learning programming constructs like loops, functions etc. you could focus on learning the actual syntax. This is what I did over the summer before my degree started (with Java rather than C++) so that when the logic was explained in lectures, I was already familiar with how to type it - and was just learning what it actually meant.

I found that other classmates who didn't take this approach got bogged down in details of syntax and formatting and missed the real essence of what the lecturer was trying to convey.

Hope that's useful to you, good luck in your studies!
 
Back
Top Bottom