Sign in to follow this  

give up learning C++?

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

I just saw on this very forum: "There is no way you could have mastered C++. C maybe but C++ is not even fully defined yet so it's impossible." Maybe I should wait till C++ is complete before learning - why have to learn some parts of C++ for nothing? What is your advice?

Share this post


Link to post
Share on other sites
Learn it. You don't have to be a "master" of a language to produce useful things from it. Start with simple programs and grow to bigger ones, increasing your knowledge of the language as you go. You can do a *lot* with even a subset of C++.

Share this post


Link to post
Share on other sites
If you stop learning something every time someone tells you to, you wont master any language. [smile]

C++ has some areas of it that are undefined, but not in the way you think, and not in the way the person who told you that thinks. (And how could he? He doesn't use C++, so he's not a good source of C++ related information)

The areas of C++ that are undefined, are the things that happen when you use C++ in weird ways that you aren't supposed to. If you use C++ normally, you'll come undefined things rarely, and when you do, it's easy to look up how to do things the right way, and avoid the undefined places.

By 'undefined', I don't mean that C++ has features in the language that say, 'Sorry, we haven't implemented this yet, check back later!'. That'd just be stupid. [grin]

C++ is complete. It's still being upgraded, as are other languages, but it is complete. Some parts are undefined, but that doesn't mean they aren't completed, that just means that you aren't supposed to do that.

If you have already started learning C++, definitely don't give up and switch languages.

But if you haven't started learning C++, then definitely consider learning something else. Not because C++ isn't 'complete', but because it's a difficult thing to learn, and there are easier languages.

If you feel comfortable with C++, press onward! If C++ seems confusing, but you are able to understand it bit by bit, stay with it! If you haven't started learning C++, or only played with it for less than a week or two, go check out Python, it'd be much easier on you.

But by all means, don't listen to anyone trying to convince you to switch languages without giving any good reason why; and even then, don't take what they say and unthinkingly apply it to your particular situation, because your situation isn't their situation, and they don't know what's best in your case.

Share this post


Link to post
Share on other sites
The language is constantly evolving, but the same is true of all languages.

If you had somehow "mastered" the original 1998 standard, everything you learned would still be applicable today.


The post you are quoting was talking about the next version of C++, which will be finalized this year or next. The changes in the C++0x standard are very minor adjustments and the additions of some useful functionality. The standards committee is extremely cautious about changes that could break old code.



Refer to the forum's FAQ for a list of good C++ books, starting with Accelerated C++. Alternatively, you could go look at other languages that have a faster learning curve to cut your teeth on.

Share this post


Link to post
Share on other sites
Will you give up about trying to drive a car because you can have an accident? Sure, the way you seems to look at it, you don't WANT to learn C++, and if you don't have any dedication you will never succeed.

Share this post


Link to post
Share on other sites
@ Servant of the Lord: Thanks for the advice.
1)'Sorry, we haven't implemented this yet, check back later!'- that was exactly what I was afraid of :)
2)"go check out Python"- sorry, I've put much time and patience in C++. And I really need all the horsepower eg. necessary to fuel games like Doom 3 or FEAR. If someone can assure me Python can handle that kind of task (rendering speed mostly) without compromises, I'll be more than happy to learn it. But otherwise, no- I really need the premium package.

Share this post


Link to post
Share on other sites
Quote:
Original post by asdqwe
2)"go check out Python"- sorry, I've put much time and patience in C++. And I really need all the horsepower eg. necessary to fuel games like Doom 3 or FEAR. If someone can assure me Python can handle that kind of task (rendering speed mostly) without compromises, I'll be more than happy to learn it. But otherwise, no- I really need the premium package.

Doom3 and Fear are simply massive projects. By the time you are competent enough to handle them, you will (or should) already know a number of programming languages.

That aside, if you already have made an investment in C++ - see it out to the bitter end. Better to finish learning any language than have a number of half learned ones. Whether one can really finish learning C++ is outside the scope of this reply [grin]

Share this post


Link to post
Share on other sites
If you wonder what this undefined behavior looks like, here's an example:

int i = function1() + function2();

You can compile and run that code, but the C++ standard does not define the order in which the functions are called. Maybe function1 first and the function2, maybe the other way around. If your program depends on the order, this is a bug. If it doesn't, all is fine.

Share this post


Link to post
Share on other sites
That's not undefined behavior; with undefined behavior anything can happen. With that code sample there are only two possibilities: either function1() will be called first or function2() will be called first.

Share this post


Link to post
Share on other sites
Thanks for the correction. I have been away from C++ and fiddling with assembly for too long ;)

So "The order of evaluation of arguments is undefined" really isn't undefined behavior?

Share this post


Link to post
Share on other sites
The standard actually says "the order of evaluation of operands of individual operators and subexpressions of individual expressions, and the order of in which side effects take place, is unspecified."

Share this post


Link to post
Share on other sites
Quote:
Original post by SiCrane
The standard actually says "the order [...] is unspecified."

Thank you very much, now I finally understand the difference between undefined and unspecified.

Share this post


Link to post
Share on other sites
You can't go wrong learning C++ trust me.

Sure... It's evolving... For the better I might add, but if you're able and willing to learn it then go for it!

In addition to other languages, C++ will set you up quite nicely to learn C or C# if you so wish, as well as enabling you to understand the fundamentals of object oriented programming, which is common in most of the modern languages of today.

So it’s a win win situation!

Share this post


Link to post
Share on other sites

C++ is THE language for apps that run on the clients computer. Becuase it's small, fast, and difficult to decompile.



If your programming for a website or something that runs on a server i'd go with Java or C#.

Share this post


Link to post
Share on other sites
Quote:
Original post by BlueMoonRising

C++ is THE language for apps that run on the clients computer. Becuase it's small, fast, and difficult to decompile.



If your programming for a website or something that runs on a server i'd go with Java or C#.


Huh? Difficult to decompile? Every language is equally difficult to compile; you just need to know the assembly equivalent for standard assignments and statements in whatever language that you use. Decompiling is the same regardless of what language was used to write the program, and any program can be decompiled into any other language. You just gotta do the work.

As far as C++ goes, by all means LEARN IT!! Let's face it, you're not going to be making a 3D shooter anytime soon, so really, what you are learning is the structure and syntax of the language, and the logic behind programming. Nothing creates good programmers better than conquering C/C++. The structure of C/C++ is used in many other languages, such as Java, C# (you know, non-cross platform Java), PHP, and other proprietary languages (I used to use NWScript for Neverwinter Nights scripting). If you learn C/C++, you effectively learn ALL of those languages. Sure, there are the nuances and the ins and out of any language to learn, but the fundamental concept is the same.

It's like learning to drive. Should you learn to drive an automatic or a manual transmission vehicle? Well, manual, of course. Even if you drive an automatic, learning to drive a manual gives you a greater understanding of what is going on under the hood, and also gives you the ability to drive ANY vehicle. Sure, some may be automatic, some may be manual. Some may be red, some may be blue. Some may have power windows, some may have no windows at all. Some may have two wheels, three or four. But the underlying concepts are the same, therefore, becoming proficient with any vehicle will be easy given an introductory learning period.
That's not the same for my mother who has never ever learned how to drive a manual transmission vehicle before. She almost blew the three wheeler one day because she couldn't grasp the concept of shifting. She just thought, push the button and go. See, how even learning the concepts of driving a manual transmission vehicle would have helped even my mother drive a three-wheeler?

C/C++ is the manual transmission of programming languages. It's fundamental. Learn it.

Share this post


Link to post
Share on other sites
Yes, you should learn C++, but don't give up on other languages either. Working with and learning multiple languages at the same time really improves your understanding of all of them, since different languages have different features and personalities that you utilize. Sometimes a concept in one is extremely difficult, yet in another it is simplified so much, you don't even pay any attention to it after a little while.

Share this post


Link to post
Share on other sites
Quote:
Original post by BlueMoonRising
C++ is THE language for apps that run on the clients computer. Becuase it's small, fast, and difficult to decompile..

Any actual links which prove this statement? AFAIR compiled C++ code is rather easy to decompile if you aren't using some kind of obfuscator tool.

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
If you wonder what this undefined behavior looks like, here's an example:


Here's an actual example of undefined behaviour.

int a=1;
std::cout << (++a + ++a + ++a) << std::endl;


which will give you different answers on different compilers. MSVC for example will do all of the ++ operators first, then the binary adds. gcc will do 2 ++'s, followed by +, followed by another ++ then the final +. Both are unfortunately valid interpretations of the C++ language spec - which give 2 completely different answers.

Share this post


Link to post
Share on other sites
Apart from the undefined/unspecified debate,
In my opinion, on the long run, mastering a language does not always give you the advantage.

The language itself is the small part - mastering the logical and theoretical side is the important part.

If you know how to build a recursive genetic AI algorithm in one language, you will know how to do it with another.
Just a matter of syntax and basic restrictions forced by the language.

If you know C++, you can easily learn Java, php, javascript, pascal, etc...

You should strive to become flexible - being able to adapt languages and different syntax as you go. Because that's the easy part of programming.

The logical side is far more important than knowing which function is called first.
This is just something that pure practice can teach you.

In short, don't learn a language thinking you will be using it for the rest of your life.
Treat it as a dynamic tool similar to other tools out there that are constantly forming and improving.

Just my 2.5 cents ;P



Next Life Insurance
Is it really thinking?

Share this post


Link to post
Share on other sites
Quote:

Any actual links which prove this statement? AFAIR compiled C++ code is rather easy to decompile if you aren't using some kind of obfuscator tool.

Quote:

Huh? Difficult to decompile? Every language is equally difficult to compile; you just need to know the assembly equivalent for standard assignments and statements in whatever language that you use. Decompiling is the same regardless of what language was used to write the program, and any program can be decompiled into any other language. You just gotta do the work.

I suspect he meant to translate back from the compiled executable to C++. It's trivial to translate to assembly, for example. Getting back into actual C++ is harder, and getting something that resembles meaningful C++ is almost impossible. There's so much contextual and semantic information that lost in the compilation process for C++ -- it's an extremely destructive transformation.

Just because you can turn a random executable into technically-legal C++ doesn't mean that C++ is in any way more readable or useful (in, say, the hands of somebody doing some kind of evil reverse-engineering work) than the far-easier-to-obtain assembly.

Certainly there's been some research into this area, but the results are pretty lackluster.

Share this post


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