C First?

Started by
48 comments, last by All8Up 12 years, 2 months ago
I have noticed as a rather recurring trend that quite a few people seem to recommend learning C before learning C++.

When I was starting out, the option was basically taken from me ( C++ was fairly new and compilers were scarce ), so I never had to make this decision. I have my own opinion on the subject now, but I don't want to taint the thread with it. So I was hoping to do a quick survey.




Questions:

Do you recommend a new developer learn C before C++?
What skill level would you consider yourself in C++ today?
Why? ( either way EDIT: Why as in do you recommend for/against C++ first, now why do you consider yourself a certain skill level. ;) )
Advertisement
My personal thoughts on the subject.

Learning C first is bad, very bad. At this stage in the game, C and C++ are completely different languages and should be treated as such. I can personally see very little to no real advantage of learning C first, except perhaps as a erudite pursuit. That there are C underpinnings to C++ that are there for legacy reasons only, not learning C first removes the user from exposure to this "cruft". I don't really think that knowing 100% of a language, especially deprecated aspects, makes you a better C++ programmer.


I would consider myself a pretty piss poor C++ programmer, but I do have 15+ years exposure to the language, while only 2 of those in professional use.
Do you recommend a new developer learn C before C++?[/quote]
Depends.

What skill level would you consider yourself in C++ today?[/quote]
Yes.

Why?[/quote]
Yes.
Waste of time.
You will need all your time and more to get into that C++ zombie.
i think for a complete noob.. C can offer an easier way in, it's a smaller simpler language. At the very beginning of programming I think the guy is already confused by the very idea of variable, control flow and function calling.. no need to get more confused with OOP stuff. For the very first steps a language such as standard basic or pascal migh also do.
Having said that, the danger is to fall into the trap of things like "ah ok, I get C++ now, you use cout instead of printf and class instead of struct".. which is exactly what I did when I was trying to transition to C++ with a background in old basic and C. It's funny that I really understood C++ when I started to study Java.. there you are forced to go OOP or die.

I don't have an answer.. programming is hard and to get good at it you need to WANT IT .. languages perhaps don't really matter.. commitment does. any serious programmer should and will end up knowing at least 3-4 languages from average to good.

Stefano Casillo
TWITTER: [twitter]KunosStefano[/twitter]
AssettoCorsa - netKar PRO - Kunos Simulazioni

One should learn the language most suited to the task they wish to accomplish.

95% of the time, that means neither C nor C++.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]


One should learn the language most suited to the task they wish to accomplish.

95% of the time, that means neither C nor C++.

Indeed. 95% of the time you should learn...
HASKELL

On a more serious note:
C and C++ share some history. That's about it right now. There has been some standing movement in the C and C++ world to bring the two languages closer together, however that's all it really is...

From a learning perspective starting out with C vs C++ does not give you any particular advantage. Both languages have the same pitfalls in the same areas, although C++ also has other areas with other pitfalls that you must avoid. The thing is, from a learning perspective you're not likely to hit those "more advanced" pitfalls until you actually GET to those C++ features.

If you're hellbent on learning C++, learn C++. Don't learn C. Someone else actually put that better..

In time the project grows, the ignorance of its devs it shows, with many a convoluted function, it plunges into deep compunction, the price of failure is high, Washu's mirth is nigh.


Do you recommend a new developer learn C before C++?

Depends.

What skill level would you consider yourself in C++ today?[/quote]
Yes.

Why?[/quote]
Yes.
[/quote]

Very informative, but I have to disagree with you on that last part there.
There's really no advantage to learning C first. If you don't want to go head-first into OOP, a much better option is to restrict yourself to the C-like subset of C++. You'll get a much nicer language to use with more modern thought behind it and you'll also have all the C++ extras to play with for times when they may come in useful.

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.


Do you recommend a new developer learn C before C++?

Definitely not. It'd hamper your ability to understand C++, not enhance it.

What skill level would you consider yourself in C++ today?[/quote]
Decent. Not an expert, but not a novice either.

Why don't you recommend C++ first?[/quote]
Because C++ is not C. It is a different language that is backward compatible with C. That was 15 years ago.
Now it's even more different. Still backwards compatible, but very different.
The fundamental difference is not new features, or different keywords, but different ways to think. If you start with C, you'll learn to think in a different way from that which C++ is trying to teach you.

But you're in luck! C++ just changed again. The new C++11 standard version of the language makes (or is in the process of making) C++ more modern, cleaner, faster, and easier to learn then ever. In may be difficult, since C++ is in transition from the "old" C++ to the "new" C++, and there's a lack of resources, but soon good tutorials and books will be coming out that teach the refined and enhanced C++ for beginners.

That said, it may be better to start with a language like Python. But if your choice is between C and C++, it's not even a choice that needs to be seriously considered... Go C++.

My suggestion would be: Learn Python and stick with it for several years, and after that learn C++. Learning Python _will_ help you learn C++, while also giving you skills in Python that are valuable in themselves. Learning C will help some, and hinder some, and the skills wont really be valuable in their own right, unless you are working in some very specific circumstances.
What I mean is, if you know C++ and Python, you'll find circumstances to use both even when you know both. If you know C++ and C, you'll only find circumstances to use C++ except in very rare scenarios.

This topic is closed to new replies.

Advertisement