C++ first so bad???

Started by
27 comments, last by Captain Logic 19 years, 5 months ago
I don't see why everyone bags on C++ being your first language. I started programming a few months ago with C++ with Sams Teach Yourself. I thought that it was a very good language to start with. I think if you just pay careful attention to what your reading and maybe reread what you dont understand it is not that hard to understand. Does anyone else feel this way or is it just me? Tallshort
Advertisement
I think the main reason people don't suggest starting with C++ is that it relies much more on actually cleaning up memory and releasing system resources. Also, other languages, such as BASIC and HTML, are generally easier to use. I'm a major fan of Flash Actionscript, it's as simple as BASIC with much more power (even if it's much slower).

However, I too started with C++, and C++ teaches you a LOT of good programming methods. And if you start higher with C++, the other languages are easier (like learning Latin and then French).
- Charles Jackson, Hedonism Games, developer of Crush the Critters (Alpha Jan '08!)- http://www.hedonismgames.com- Email: CataclysmicKnight@gmail.com
Quote:Original post by Tallshortkid
I don't see why everyone bags on C++ being your first language. I started programming a few months ago with C++ with Sams Teach Yourself. I thought that it was a very good language to start with. I think if you just pay careful attention to what your reading and maybe reread what you dont understand it is not that hard to understand. Does anyone else feel this way or is it just me?
I have been using VB for years and C++ is very hard to learn when compared.

C++ is not the easiest language to learn, I am have gone through 3 beginners books to find one that relates to me the best. C++ is not very hard as long as you are interested in learning it and are not getting bored.
__________Michael Dawson"IRC is just multiplayer notepad." - Reverend
I do, i did the exact same thing. i C++ was the first language i learned with SAMS, and i didn't really have any problems understanding it. but for the other that have trouble understanding the language its best to start with an easy language like vb.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="88" height="70" id="H2lvl" align="middle"> <param name="allowScriptAccess" value="sameDomain" /> <param name="movie" value="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" /> <param name="quality" value="high" /> <param name="wmode" value="transparent"> <embed src="http://www.ironhive.com/CFCs/H2lvl.swf?gamertag=jBaddog" quality="high" bgcolor="#ffffff" width="88" height="70" name="H2lvl" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> </object>
I learned first C and after a half a year I began with C++. The transition was moderate, but not difficult. I learned programming on college, so I had 'profesional' help, plus some other student helping eachother out.

I first began programming in Borland (which is almost entirely object-oriënted), after a year (now) I started with MS visual studios C++ 6.0.

It is quite easy if you study long enough!
I started with C++ and I honestly feel that I have learned the language and applied it better than people I know who have come from other programming language backgrounds. There is no doubt in my mind that a lot of this is because of C++'s nature as a multiparadigm language as well as the fact that it grants many very high-level features, yet still keeps low-level details visible and potentially manageable.

When you start with another language, particularly one which is strictly procedural, or even one that is strictly object oriented, you learn to use the paradigm for situations where other methods provide a better solution, such as with functional programming. Unfortunately, since your language may not support other paradigms, you don't even realize that there is a better solution. There are times where you may say "I wish there were a more elegant solution," but learn to grit your teeth and do what you can with whatever tools you have. When programming in C++, you learn and use other methods which may fit the situation better.

People get so used to sticking to their original programming language's paradigm such that even when they go to a language like C++, they tend to stick with the methods they are used to. Experienced C programmers tend to neglect object oriented features. Experienced Java programmers tend to over-use member functions instead of templated functions, such as the style of STL algorithms. Even if you attempt to explain benefits of other approaches they will often ignore them anyways since they already know they can accomplish the same results with their paradigm, even though their method may be less elegant.

A person coming to C++ from other languages may be overwhelmed by new tools they had no idea existed and may hesitate to use them in favor of methods they've gotten used to in situations where they may not be appropriate. Conversely, one going from C++ to another language may be left thinking "I wish this language were capable of doing *insert C++ capability here*." I'd rather be of the latter group than the former.

While other languages can make certain specific tasks easier, I personally believe that an early introduction to multiple paradigms is much more important than quick results. This may be more frustrating to people who wish to get immediate results when they are learning, but overall I feel it creates a much more firm understanding of fundamental programming concepts and teaches the programmer to be aware of a multitude of tools which other languages simply can't provide.
c++ can be hard at first, thats true.
but if you get bored then it can also be the book's problem.
when i started learning c++ at first (c++ is my second programming language i know, the first is PERL), i used a very boring book.
it was too long, i think its the book you're using now.
anyway, i would look at tutorials, such as cplusplus and cprogramming (these books can help if you want to learn more things that you cant find in the tutorials)
pex.
It often depends on how far you want to go with your programming. Sometimes people who learn in a "higher-level" language end up not really understanding how the computer actually works internally... or the ways a compiler generates machine code, etc. I have always felt that having this solid low-level understanding is priceless.

If I had my way, every aspiring game programmer would be forced to use nothing but assembly language for the first few weeks, just to form a good understanding of how the car works under the hood.
Quote:Original post by Polymorphic OOP
I started with C++ and I honestly feel that I have learned the language and applied it better than people I know who have come from other programming language backgrounds.

This is a very generic statement. Replace 'C++' with *insert your first language here* and the statement will match most who started with that language.
Quote:
When you start with another language, particularly one which is strictly procedural, or even one that is strictly object oriented, you learn to use the paradigm for situations where other methods provide a better solution, such as with functional programming. Unfortunately, since your language may not support other paradigms, you don't even realize that there is a better solution. There are times where you may say "I wish there were a more elegant solution," but learn to grit your teeth and do what you can with whatever tools you have. When programming in C++, you learn and use other methods which may fit the situation better.

I beg to differ. Most operating system kernels are implemented in assembly language and C. Yet you will find OOP patterns there. Being multi-paradigm is not a property that only (or mostly) fits C++. Though I agree that you will try to do things 'the C++' way if you are used to it. Even if other languages provide better solutions. Man is a creature of habit and thus the above again perfectly fits *insert the programming language you started with*. No plus for C++. If you where used to Scheme or ML you'd miss lambda expressions. If you where used to C# you'd miss true delegates or properties.
Quote:
People get so used to sticking to their original programming language's paradigm such that even when they go to a language like C++, they tend to stick with the methods they are used to.

Exactly.
Quote:
While other languages can make certain specific tasks easier, I personally believe that an early introduction to multiple paradigms is much more important than quick results. This may be more frustrating to people who wish to get immediate results when they are learning, but overall I feel it creates a much more firm understanding of fundamental programming concepts and teaches the programmer to be aware of a multitude of tools which other languages simply can't provide.

I think it's rather limiting them. Mmany many many many beginners struggle with the syntax and have semantic problems with C++. Fundamental programming concepts never depend on a particular language (BTW. CataclysmicKnight: no HTML is not considered a programming language[wink]).
Take for instance Object Pascal. I don't see any difference between OP and C++ with regards to being multi-paradigm. The same goes for Phyton. Why would you not recommend learning any of these two first?

Some people do have their issues when entering the world of programming so why scare them away with archaic stuff like header files and pre-processor directives? C++ is a complex beast and hard to master (those who disagree with this obviously just haven't enough experience with it[wink]). And this is why I'd say it's not the best choice to start programming with for most! If it worked out for you, that's fine. When I look at all those 'my compiler hates me'-post in the beginner's section I wonder why anyone may think C++ is good to start with [smile].

One last thing - don't ever think it's the programming language that makes you a good programmer and teaches you things. It's using it properly! And this applies to just about every programming language out there, not just C++.

Sorry for me not shutting up[grin],
Pat.

Using C++ on a daily basis at uni and work for over 8 years now and still enjoy it. Just needed to add this to point out that I don't havae any resentment against C++ - I just know it's odds, too.
Quote:Original post by darookie
I beg to differ. Most operating system kernels are implemented in assembly language and C. Yet you will find OOP patterns there. Being multi-paradigm is not a property that only (or mostly) fits C++. Though I agree that you will try to do things 'the C++' way if you are used to it. Even if other languages provide better solutions. Man is a creature of habit and thus the above again perfectly fits *insert the programming language you started with*. No plus for C++.

Woah, woah, there :p I never said C++ was the best and only language to begin learning programming. I was defending C++ for all of the bashing it normally gets as an introductory language. Its foundation as a multiparadigm language makes it a great learning opportunity. It gives an early programmer a chance to experiment with procedural, object oriented, and functional programming, as well as allow them to see low-level details. This is something that very few other languages can provide.

Also, there's a difference between using object oriented patterns and actually using a language designed to handle the object oriented paradigm. In other words, you're not going to do too well teaching someone object oriented programming by having them learn assembly, even though you can create object oriented design patterns. With C++ or other languages that directly support the paradigm, it makes things much easier.
Quote:Original post by darookie
If you where used to Scheme or ML you'd miss lambda expressions. If you where used to C# you'd miss true delegates or properties.

But you can use simulated lambda expressions and delegates in C++ as well (see boost), which many people actually do -- myself included. With C++, you can pull in a lot of concepts from other languages making it a nice way to learn a variety of concepts that would otherwise usually require you to learn several different languages at once. Even then, you don't get the chance to use them together easily, which is a great benefit in its own right.

Quote:Original post by darookie
I think it's rather limiting them. Mmany many many many beginners struggle with the syntax and have semantic problems with C++. Fundamental programming concepts never depend on a particular language (BTW. CataclysmicKnight: no HTML is not considered a programming language[wink]).
Take for instance Object Pascal. I don't see any difference between OP and C++ with regards to being multi-paradigm. The same goes for Phyton. Why would you not recommend learning any of these two first?

Again, I never said "don't learn other languages first." I was explaining why C++ is not a bad choice to learn first. My points were focused towards teaching a multiparadigm language versus teaching a single paradigm language. I talk primarily about C++ because it was the language mentioned in the original topic, it is the language I personally have the most experience in, and also because it is one of the most versitile languages around.

This topic is closed to new replies.

Advertisement