Sign in to follow this  

c++ or not c++ thats the question

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

Hello everyone. I've been learning c++ on and off for a year or so. I've seen several posts that say someone shouldn't learn that language first. Now im curious if i should give up on it for now and try something else like darkbasic. Or just stick with it. I don't really care about how long it'll take me to consider myself a "good" programmer. I just like to learn how to make games and maybe down the road get a job as a programmer. Also, i dont want to just jump to another language but if it'll be easier to produce games......

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
C++ is relatively difficult. If you were to ask me a good starting language I would have to vote for a BASIC like one.. However that doesnt mean it is impossible to start with C++.

The basic ideas are the same, just C++ has a lot more weird symbols, and ways to crash ur PC ;)

you have already started C++, and if you think you can keep it up- Go for it! If you can learn C++ you will find nearly any other language easy by comparison ;)

At the end of the day you will probably need to learn C++ anyway ;)

Share this post


Link to post
Share on other sites
Agreed: if you've been doing it for a year, and might want a job in game programming, stick with C++ until you feel pretty confident with it. Then you can branch out into other languages (I like Python, for example).

Share this post


Link to post
Share on other sites
Well it depends how comfortable you feel with C++ and what kind of stuff you're capable of with it. If you're still strugling with creating a basic game then go take a look at another language, you may decide to continue using C++ but you may prefer to try making a game with the new language instead (Python may indeed be a good choice). If however you're comfortable with C++ and getting what you want done I see no immiediate reason to change. Though you will want to look at alternative languages at some point.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
At the end of the day you will probably need to learn C++ anyway ;)


I'm not very sure of that. In fact I am pretty sure C# will do to C++ what C++ did to C. The main reasons are

  • A big company has put lots of resources on creating this language, and they succeded on making it good.

  • It is an open standard.



So I advice you to download MS Visual C# Express Edition and go through some basics of C#, for instance reading the tutorials on softsteel.co.uk - C# Tutorials. You will also need the .NET Framework 2.0.

[Edited by - Enselic on January 26, 2006 3:53:32 PM]

Share this post


Link to post
Share on other sites
C++ is still the undisputed king of commercial games. It's pretty much expected that if you plan to get a job as a game programmer you will very likely be using C++. As a hobby developer though by all means evaluate the alternatives, since using something like C# will dramatically increase your productivity.

Share this post


Link to post
Share on other sites
I truly recommend the D programming language. It's a higher-level language than C++, yet it retains its runtime efficiency. Check this page for a comparison other languages:

But I'll have to warn you that there aren't any English books about D, so you'd have to learn it from online tutorials and the language specification (which is actually a very good one). You might sometimes also stumble upon a compiler bug, but these tend to disappear quickly, if reported to the newsgroup.

If that doesn't stop you, there are D bindings for libs such as OpenGL, Direct3D, SDL, OpenAL, DevIL and more :)

Share this post


Link to post
Share on other sites
Quote:
Original post by Enselic
Quote:
Original post by Anonymous Poster
At the end of the day you will probably need to learn C++ anyway ;)


I'm not very sure of that. In fact I am pretty sure C# will do to C++ what C++ did to C.


(just so you know, tldalton1622) I disagree.

Share this post


Link to post
Share on other sites
Quote:
Original post by Enselic
In fact I am pretty sure C# will do to C++ what C++ did to C.


The day when device drivers and embedded systems are written in C# will be the day I become bricklayer. [sick]

Share this post


Link to post
Share on other sites
For the benefit of the original poster, I disagree with the idea that C# will ever succeed C++ in the way that C++ succeeded C, and it's by no means a majority view that this will happen. Look here for one reason why. NB: this doesn't mean the language is bad or useless or anything like that, just that I don't think it will achieve what the others suggest.

Share this post


Link to post
Share on other sites
Quote:
Original post by Enselic
Quote:
Original post by Anonymous Poster
At the end of the day you will probably need to learn C++ anyway ;)


I'm not very sure of that. In fact I am pretty sure C# will do to C++ what C++ did to C. The main reasons are

  • A big company has put lots of resources on creating this language, and they succeded on making it good.

  • It is an open standard.



So I advice you to download MS Visual C# Express Edition and go through some basics of C#, for instance reading the tutorials on softsteel.co.uk - C# Tutorials.


Negative.

Remember the .NET? Not everyone that is happy with C++ is willing to install the real or hacks of .NET just to use C#.

This wasn't an issue when C++ took over C.

So, I get rated negatively for expressing opinion? [sad]

Share this post


Link to post
Share on other sites
Quote:
Original post by rip-off
Quote:

This wasn't an issue when C++ took over C


no, inefficient code generating compilers and non-standard language features were


Well...

C++ compilers were just converting the code into C code and then C compilers compiled it.

It's actually possible to write anything in C++ in C :). Even an std::vector, named just vector.

EDIT: I mean, C++ compilers of the past...

[Edited by - agi_shi on January 26, 2006 3:03:37 PM]

Share this post


Link to post
Share on other sites
Even if C# will not become as commonly used as I suspect it will, it is still a good beginners language. And the fact that you can use it for high quality hobby games, makes me want beginners to at least try it out.

And the argument that "people will not want to install the .NET framework" I don't understand. Isn't it better to keep all common tasks in one big .dll collection instead of distributing these with your applications?

And yes, maybe I was too optimistic stating that C# will take over C++s roll in games developing in general, but I belive it is certain that C# will take over C++s roll as a Windows app/games language. And as mosts gamers sits on Windows machines, I belive C# fits real well as a gameprogramming language. Both now and for the (at least windows) future.

And these performance comparisions all give diffrent results, look here for instance. And besides, you will have to compromise runtime speed for developing speed. The higher you go in programming languages, the more speed you will sacrifice. To me, and I guess most hobbyists, this sacrifice is worth it.

Share this post


Link to post
Share on other sites
c# is like a CRV, easy to drive, easy to use, easy to learn.

C++ is a F1 Ferrarri. It's difficult to grasp, but much better in terms of performance compared to c#.

In my personal experience, as long as you're sticking with "object oriented" programming languages you should be fine. NEVER start in VB and C (like I did, and both too). I can't seem to get rid of the procedural habit and mentality out of my mind sometimes.

with that said, I think C++ is the best beginner's language. The most important thing is to build up the type of mind set, avoiding sloppy programming because C++ is , err... less forgiving. If you are already fairly good in C++, other languages come in a click. Assume that you're learning to ride a bike on 2 wheels instead of the 4-wheeled type (the ones you see on kid's bike), when you can ride pretty well the 4-wheeled bicycle should be a piece of cake.

just my personal opinion though.

Share this post


Link to post
Share on other sites
Quote:
Original post by Enselic
Even if C# will not become as commonly used as I suspect it will, it is still a good beginners language. And the fact that you can use it for high quality hobby games, makes me want beginners to at least try it out.

And the argument that "people will not want to install the .NET framework" I don't understand. Isn't it better to keep all common tasks in one big .dll collection instead of distributing these with your applications?

And yes, maybe I was too optimistic stating that C# will take over C++s roll in games developing in general, but I belive it is certain that C# will take over C++s roll as a Windows app/games language. And as mosts gamers sits on Windows machines, I belive C# fits real well as a gameprogramming language. Both now and for the (at least windows) future.

And these performance comparisions all give diffrent results, look here for instance. And besides, you will have to compromise runtime speed for developing speed. The higher you go in programming languages, the more speed you will sacrifice. To me, and I guess most hobbyists, this sacrifice is worth it.


the difference between C and C++ and C++ with C# is the transitional stages you have to go through. Although C & C++ are closely related, it was difficult to make the transition because of the different metathologies(sp?) in the programming languages. C programmers will have to unlearn somethings in order to fully grasp the concept of C++. While, C# is more like a beginner's version of C++. Any programmer who's sufficiently profficient with C++ can master C# fairly quickly.

anyway just my personal opinion from personal experience, and I have nothing to back this up.

Share this post


Link to post
Share on other sites
Quote:
Original post by Takaloy
The most important thing is to build up the type of mind set

I agree! But C++ is too complicated for that. Too many traps.

I like the bicycle comparision you made.

But when you started to ride a bike, you didn't start with 2 wheels, right? You hade 2 other smaller wheels mounted on the sides. Then when you learned how to hold your balance pretty well, you removed these.

Well, yeah ofcourse, if you learned how to ride a 2-wheel first, the 4-wheel would be piece of cake.

That however would take longer time and you would fall and hurt yourself. Maybe you would give up learning because of all the pain it caused you!

Share this post


Link to post
Share on other sites
Quote:

So, I get rated negatively for expressing opinion?


If I was here with the sole purpose of making my rating shine, rating you down would be a good start :D

Share this post


Link to post
Share on other sites
Quote:
Original post by Enselic
And besides, you will have to compromise runtime speed for developing speed. The higher you go in programming languages, the more speed you will sacrifice. To me, and I guess most hobbyists, this sacrifice is worth it.


This is not necessarily true. C# compromises runtime speed because it's an interpreted language. But there are higher-level compiled languages which are as fast as C/C++ while being more friendly to develop in.
But generally, I agree with the point that often development speed is sometimes more important than runtime efficiency.

Share this post


Link to post
Share on other sites
Quote:
Original post by Takaloy
c# is like a CRV, easy to drive, easy to use, easy to learn.

C++ is a F1 Ferrarri. It's difficult to grasp, but much better in terms of performance compared to c#.


Define preformance.

For a business app, I'd most likely define this to be "how fast can I get it to the shelves/my employer". A RAD (Rapid Application Development) toolset, and simple-to-use language win here, not C++, with it's big can of "undefined".

For a typical FPS, I'd most likely define this to be "how fast can I get my framerate with the latest graphics". Most of this work is done by your graphics card. Hardware engineering and shader languages win here, not C++.

For some AI-heavy strategy games, or some games with whackilly expensive physics simulations, or scientific number crunching, C++ may win. CPU or Memory tends to be the main factors here.

Languages that are not C++ have some or all of the following advantages in those two categories:

CPU:
* Garbage Collection: No need to clean up blocks if the program terimnates before running out of memory. Can relocate memory blocks used at the same time together, reducing time spent waiting for pages to load. No counter (de)incrementation for reference counting multi-owner objects.
* Platform-specific JIT: No need to target the lowest common denominator of CPU instructions and optimization techniques, can be custom tailored to local system.

Memory:
* Garbage Collection: No memory leaks. Can reduce fragmentation by similarly relocating memory blocks.

Thus, C++ may still be a loose for systems with both of those problems as limiting factors.

There are few reasons I still use C++. Among them:
1) It's the language I'm most familiar, and thus comfortable, with.
2) RAII for non-memory resources seems harder with many GCed languages (see 1).
3) I hate that the garbage collector can run at basically any time, for an unbound length of time.

I will eventually stop using C++ except for legacy support, reason being:
1) I'm working on learning other languages, if only to steal their ideas.
2) RAII for non-memory resources is quite doable with many/most/all GCed languages.
3) Garbage Collectors are becomming freakin' uber.

Quote:
with that said, I think C++ is the best beginner's language. The most important thing is to build up the type of mind set, avoiding sloppy programming because C++ is , err... less forgiving.


I'll disagree here!!! Define "less forgiving". For me, to finish that sentance, I'd say "less forgiving means random undefined behavior at runtime and hard-to-track bugs instead of compiler errors and a system which dosn't allow many bugs to surface in the first place". This would be a definate disadvantage for C++, taking time away from learning to avoid sloppy habbits by forcing you to invest in learning how to use a memory leak detector, among many other bits of knowledge required to get your program running once more.

Quote:
If you are already fairly good in C++, other languages come in a click.


Is this because C++ is a superior learning instrument, or because C++ is simply the hardest to learn, and the relative ease of learning another language simply the contrast between learning C++, and said other languge?

Quote:
Assume that you're learning to ride a bike on 2 wheels instead of the 4-wheeled type (the ones you see on kid's bike), when you can ride pretty well the 4-wheeled bicycle should be a piece of cake.


I learned to ride a trike before a bike-with-training-wheels, and a bike-with-training-wheels before a bike. I had a lot of fun being able to go places before I was able to learn how to balance, which helped fuel my motivation to learn how to do the same thing without said training wheels. Being able to steer and turn the pedals made learning to balance a whole lot easier. Maybe if you're masochistic, falling a lot while you learn how to steer and turn the pedals would be your idea of better. Certainly not mine though.

Share this post


Link to post
Share on other sites
Quote:
Original post by Enselic
But when you started to ride a bike, you didn't start with 2 wheels, right? You hade 2 other smaller wheels mounted on the sides. Then when you learned how to hold your balance pretty well, you removed these.


Nope, I never had training wheels, and I started when I was 4. Fell of about twice before I learned how not to fall off when I lost my balance. EDIT: And that's the point isn't it. Not learning how to balance, but learning what to do when you lose it, as is bound to happen.

Similarly language wise. Started at 12 or 13 (can't remember) with c++. Took a bit to get the hang of, but I think it was worth it.

Share this post


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

So, I get rated negatively for expressing opinion?


If I was here with the sole purpose of making my rating shine, rating you down would be a good start :D


LOL!!!
I can't stop laughing at this.

Share this post


Link to post
Share on other sites
Quote:
Original post by Takaloy
Quote:
Original post by pulpfist
Quote:

So, I get rated negatively for expressing opinion?


If I was here with the sole purpose of making my rating shine, rating you down would be a good start :D


LOL!!!
I can't stop laughing at this.


Umm... Ditto. (It's bold :D.)

Share this post


Link to post
Share on other sites
MM, you are most probably right. Development time is essential these days, like Benjamin Franklin once said "Time is Money". I won't say though GC is the most perfect thing on earth. For example, in a simple Library System we usually reference books to their titles instead of sub-classes. Say, if one of these classes are no longer in use, but still being referenced to, they will never-ever-be-deleted.

The advantage of C++ has over C# is you have more control over your program, you know exactly what your program is going from A-Z. Basically the difference between manual and auto-pilot I guess. I think it all depends on which language is most suitable for a specific situation. For example, if my employer has a tight constrain on development time but can afford good machines then C# is the way to go. If say, my hardware constraints are that the machines that are running this program are the 486s, and PIs then I have to think about maximizing performance. I don't remember seeing any C++ code declaring every member a virtual for a reason ;), not that I've seen alot of coding in the first place.

Personally I started off with 2 wheels, but I'd assume if I started off with 4 wheels I'd still trip and fall on 2 wheels during the transition process. I might have picked up some really nasty habits like the tendency to hold the handle stiff or turn too quickly which might be difficult to break.

Amongst all the languages I've came across (pascal,c,VB,C++,Java,C#), I agree with you C++ is the hardest. But in terms of efficiency, C++ is a mile ahead of C#. In terms of development time, I don't see Java losing any ground to C#, infact the 2 programming languages are almost similar I'd lean more toward Java because it's platform independent (or rather I might be BIAS because it's my main language).

Then again, we're in this forums ... called gamedev.net. At the moment, the gaming industry are the pioneer users of top-end hardware and I dare say that it'd be atleast 6-7 years before the hardware catches up to the level where micro-management of your code can be negligible.

Even so, if you're potent with C++, C# should be a piece of cake for you. But, if say the thread starter want to join the gaming industry and the "change" everyone is predicting did not happen - he won't make the cut. I heard of companies who reject applicants getting 97% for their C++ test.

Share this post


Link to post
Share on other sites

This topic is 4340 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this