Jump to content
  • Advertisement
Sign in to follow this  
Forestknight25

C++ = bad language to learn? I need some cheering up!

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

Oh wow, I am suffering a MAJOR blow to my self-esteem. I posted a help-wanted ad on Craigslist for a C++ assistant programmer, only to have some guy email me a few hours later telling me I was studying the "wrong language." He said C++ is "a mess," and I should instead learn Python or Java. But I truly intend to study C++, I have already begun my studying and I do not want to abandon what I have set in motion in favor of some new language I do not know anything about. So please tell me C++ is a good language, the highly versatile general-purpose language I first thought it was before that guy emailed me! I am feeling extremely emo now!

Share this post


Link to post
Share on other sites
Advertisement
C++ is not a perfect language, but neither is Python or Java. There is no perfect language, and they all have their faults.

That said, C++ is not the most beginner friendly language, it has lots of gotchas and tricks. But that's not really important. What is important is that you pick a language and stick with it.

Don't let language snobs get you down. Its much more important that you learn a language than try to find the perfect language to learn. Once you learn one, you'll want to learn several others anyway.

Share this post


Link to post
Share on other sites
No matter which language you try and learn, there's always going to be language zealots who will try and push their choices on to you.

After being introduced to the general concepts of programming via BASIC, C++ was the first "real world" language that I learnt. Over a decade later, I've learnt lots of other languages, but I still love C++ despite it's shortcomings.

Share this post


Link to post
Share on other sites
At the end of the day you need to ask yourself what you want to achieve from programming? Self gratification? A career?

I personally was taught C++ from the start and then introduced to C# and I dont regret being taught in that order at all. One point I must make is that I have been to many games graduate conferences and I noticed that Games companies are getting more and more angry that universitites are teaching languages other than C++ (the prefered games studio programming language!). So if it is a career in games your looking for then I believe you should stick with C++

Here's a nice blog that raises a few good points:
http://www.doolwind.com/blog/?p=94

Share this post


Link to post
Share on other sites
If you know C/C++ you can work with any language there is. Because most concepts were stolen or reinvented from C/C++. As for a career it is an also most expected language to know.

But for indie/hoby gamedev it is not suitable. Why? Because you have too much freedom and there are far too many concepts you could think of. For gamedev take XNA and C#. If you need you can still port it to C++.

Why am I writing that? In XNA you will manage to get a game running and you will have something to show your friends. With C/C++ you will get stuck with design concepts, WINAPI, file formats, directx pitfalls etc...

But it is not a bad language. Once you know C/C++ it will be a breeze to settle to C#. In fact, when we forget the garbage collector, the classes written in C# could be also written in C++ but that never happened. You need to do it yourself. In fact, C does not even have a string library. So either you use STL and get stuck with unicode crap, or you write your own string class. Of course there is also the "Boost Library" but there you will get stuck with templates. It's a coursed circle which never stops.

Share this post


Link to post
Share on other sites
Quote:
Original post by Samurai Jack
If you know C/C++ you can work with any should be able to quickly adapt to any imperative/object oriented language there is. Because most concepts were stolen or reinvented from C/C++ has been around since forever.
Fixed that for you.

Share this post


Link to post
Share on other sites
I think C++ is not that difficult.
It is true that it is a bit more complicated than some other languages. The reason is that you can work closer to the hardware which is an advantage if you need code with good performance. And it is still one of the most used languages (or even THE most used). This has the andvantage that there are lot of APIs, libraries and other material for C++. Native DirectX for example is always used with C++.
So if you started learning C++ you are on a good way. When you are good in C++ the step from C++ to C# or Java is a small one.
But dont forget to understand the concept of object oriented programming, because you will need it in nearly every modern programming language.

Share this post


Link to post
Share on other sites
Quote:
Original post by Samurai Jack
If you know C/C++ you can work with any language there is. Because most concepts were stolen or reinvented from C/C++. As for a career in console game development it is an also most expected language to know.
. Another correction... console game development (and PC games of the same style) are mostly C++. Casual games use many languages including C++. Outside of games, C++ is common but Java is just as widely used... and in the huge area of web-applications C++ is sidelined by Java, C# and PHP (yuck).

Share this post


Link to post
Share on other sites
C++ is not a bad language to learn, but it is a bad language to start with. The main reason is that there are many possibilities to write code that appears to do what you want (and when you compile and run you get the desired output), but that code might still be completely broken. If you try and run the code on some other compiler, computer or day of week, it may not do what you want anymore, and that can be very frustrating for a beginner. I am talking of course of "undefined behavior". Can you spot the errors in the following snippet?

int& f(int a)
{
int x = g(a++, a++);
return x;
}

Share this post


Link to post
Share on other sites
Quote:
Original post by DevFred
C++ is not a bad language to learn, but it is a bad language to start with. The main reason is that there are many possibilities to write code that appears to do what you want (and when you compile and run you get the desired output), but that code might still be completely broken. If you try and run the code on some other compiler, computer or day of week, it may not do what you want anymore, and that can be very frustrating for a beginner. I am talking of course of "undefined behavior". Can you spot the errors in the following snippet?

int& f(int a)
{
int x = g(a++, a++);
return x;
}


technically, there is only one error in there. although at one point it might not do what a beginner would expect (but is correct).

Share this post


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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!