Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello Codeproject,

After years of experience with C# I've finally decided to go one step further and learn a new programming language.

I've become quite good with programming languages, and have learned that C# is good, but doesn't fit my needs. I would have no difficulties learning either(C++/C), but would like to know exactly what the difference is between them, and which one I should choose.

I will use either of those as my final programming language that I will learn. I want to use it for developing games(3D, with OpenGL or DirectX) and developing more complex programs(Since the language is faster.)

I'd prefer to work outside of any base framework(Such as .NET) so I no longer have to have users install specific frameworks. (They should be able to just run the given game, program).

What exactly are the differences between the two? Which one should I choose, and why?

Edit: Edit:
I forgot to mention that I specifically want to write for Windows AND Linux.
Posted
Updated 4-Aug-14 22:11pm
v5
Comments
Mehdi Gholam 5-Aug-14 4:10am    
Performance depends on what you are doing, so a general comparison is meaningless.
Sergey Alexandrovich Kryukov 5-Aug-14 4:12am    
Exactly. I tried to elaborate this initial though into a pretty big answer, please see Solution 1.
—SA

This question does not make any sense at all. A computer language cannot be measured in milliseconds.

If this is not quite apparent to you, your claim about your good knowledge of C# sounds more than suspicious. And, in my opinion, most people knowing only one computer language cannot know it well, just because it often stimulated very narrow and inflexible thinking. Of course, this is not a rule, but looks like a really working rule of thumb. So, your idea to learn something else is quite productive.

Now, your idea about limitation of .NET framework is pretty much wrong. .NET can be considered as yet another platform, not much different from Windows (CLR does not have to be limited by Windows). It is pre-installed on newer versions of Windows, so your problem of limitation is a bit artificial. Yes, the user base is limited; it will exclude some users (loosers :-)). But with Windows API, you exclude, say, Linux users (but you can develop for both Windows and Linux using .NET, as well as some other platforms, including Mac OS X, for your information). Effectively, .NET can give you wider, not narrower user base. And I never heard of any serious problems with .NET performance.

Don't get me wrong: I am not trying to insist on .NET. But I would rather advise something really different, based on very different paradigms and not that archaic as C/C++. For example, Haskell, Closure, Python, Scala, F#, even Prolog (I am listing them without much thinking, just for example).

Remember:
Alan Perlis told us:
A language that doesn't affect the way you think about programming, is not worth knowing.
http://www.cs.yale.edu/quotes.html
Golden words!

—SA
 
Share this answer
 
Comments
Dimitri Nostarik 5-Aug-14 4:20am    
I've teached programming myself(I recently turned 17) by just messing with the code, and a Google every now and then, so some skills of programming are lacking - I agree with that.

I beg to differ about the comparison of languages, because every language is based upon another one - it all turns back to bits at some point. The real question is how many times does it need to translate more into bit-based information(Visual basic is a prime example of why you should not make a real language out of a programming language).

Python seems like a good choice, thank you a lot.
Mehdi Gholam 5-Aug-14 4:38am    
"Turned into bits..." is a simplistic view! take for example erlang which can handle huge amounts of connections which any other language will just die on.

So the point is not the language but your usecase and architecture of what you intend to do.
Sergey Alexandrovich Kryukov 5-Aug-14 13:45pm    
It is... I would add that the relative values of different aspects of quality and performance are changed with time and progress. Performance is taking more and more modest place with progress of CPUs and memory, so some people even say that performance does not matter anymore (even some famous people); but my answer to them would be: "you just did not do anything serious"; performance will almost be critical for some class of problems...
—SA
Sergey Alexandrovich Kryukov 5-Aug-14 13:41pm    
You are very welcome.
—SA
Mehdi Gholam 5-Aug-14 4:36am    
5'ed
Quote:
3D, with OpenGL or DirectX
C++ is better suited for such kind of programming, in my opinion.

Quote:
What exactly are the differences between the two? Which one should I choose, and why?
C is a simple, pragmatic, 'to the metal language'. It is 'universally supported'.
C++ is a complex language, multiparadigm (supports for instance OOP), it is widely supported.
In my opinon C++ is better suited for large projects. For small to medium projects C fits the job very well.

Quote:
Could anyone tell me how fast these languages are(A stress test if you will) in miliseconds?

C#:
Java:
C++:
C:

There's not an exact answer to that. There is, however, my personal feeling about.
Java is the slowest, then comes C#, then C++, finally C, which is the fastest .
But 'speed' cannot drive alone the choice of a programming language. After all, you need a programming language to write an application in a 'reasonable amount' of time.
Coding very complex programs in plain C could take forever, for instance.


Quote:
Edit: Edit:
I forgot to mention that I specifically want to write for Windows AND Linux.

There are several options available. There is Java, of course, but also Mono, allowing C# to run also on Linux, and, for instance QT for developing cross platform C++ applications: you have to do some research yourself on the matter.
 
Share this answer
 
Comments
Dimitri Nostarik 5-Aug-14 4:24am    
Thanks for getting straight to the point. I'll go for C++, and Python after.
CPallini 5-Aug-14 4:29am    
Since you mentioned Python, then I suggest you to consider also Lua.
Mehdi Gholam 5-Aug-14 4:40am    
5'ed, with only one comment if you include memory management then java and c# come on top :)
CPallini 5-Aug-14 4:47am    
Thank you.
There are many features that in some scenarios make the difference: reflection, just to name one of them.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900