C or C++ or C#

Started by
46 comments, last by Sneftel 16 years, 7 months ago
I am stuck trying to decide, originally I was only deciding between C or C++ but now theres C# and I'm not sure what to do. If at all possible I'd like to know pros and cons of each and whcih you would suggest to learn coding for an ALL AROUND programmer, not just for gaming but may be part in gaming. Thanks in advanced.
Advertisement
C: Sucks (But used a lot in operating systems, or embedded stuff)
C++: A pain in the ass.
C#: Nice and easy to use.

The best thing to do? Learn all of them.
I'd suggest starting with C# though.
A lot depends on what your goals are but I am a big fan of C# now days.

C is mainly used for legacy stuff, micro-controllers and some driver work.

C++ lots of code, examples and tutorials out there. Also a lot of people working in it, so lots of advice. A lot to learn just to get the basics down.

C#, still the new kid of the block, a lot less typing then C++ to get the same thing done. Memory management is taken care of for you. Good libraries.

theTroll
I'd agree with learn all of them.

C - I don't mind so much. It takes a bit to get comfortable with pointers and memory management, but once you get it you're all set.

C++ - I think of this as a necessary evil. I like a lot of the OO features in C++, but I hate some of the dumb notation (cout << "Hello World"; looks strange with the << compared to C's printf("Hello World!");). It's all preference though.

C# - I LOVE C#. I use XNA and .NET for all my primary programming. I recently started working with C# in OS X too because I liked it so much.

So I'd say learn C# first because it has a little bit easier learning curve. Then take on C because it'll probably be useful at some point to know it. Then learn C++. C++ builds a bit on C so knowing C will help you a lot with C++.
C# is the easiest beginner language of the three

C++ you'll need to get a job in the game biz

C is good to know

-me
I agree with everyone - C# is a great language to start with

Quote:Original post by TheTroll
C++ lots of code, examples and tutorials out there. Also a lot of people working in it, so lots of advice. A lot to learn just to get the basics down.


While this is true an enormous number of tutorials on the internet are complete crap and teach terrible habits. For some reason there is more misinformation about C++ floating around the net than most other langauges.

Personally i found c++'s extra challenge over c# interesting (pointers, memory management), but it's a matter of taste. Especially if you know c++, it will be really easy to learn the other 2. The same holds for c# to some extend. I really can't think of a reason to stick to pure c when c++'s oop features make your life so much easier, so my suggestion is: Try c# and c++ and pick the one you like most. Then learn the other one too if you want; it will be easy.
It depends on what you want to get from your learning experience. C# is probably the easiest to learn, in part because the .net framework (its standard library) is very thorough and its API reflects its RAD (Rapid Application Development) origins. You feel very productive with C#.

On the other hand, C is a great language to learn how the computer works as a machine, because it provides no high-level abstractions of its own and essentially frees the programmer to do whatever they wish (Hardware/OS restrictions aside.) You can, for example, impliment features in C that are commonly found in OO languages like C++ or C#, such as polymorphism. C can give you a window into the workings of things that you might take for granted in another language. Another plus is that C is a much smaller language than, for example, C++ (in both the number of keywords and the scope of its built-in features) so you can get your head around it more quickly.

C++ is, to a certain extent, the oft-maligned industry standard. Realistically speaking, C++ is the language you must know to develop games (and most other software) professionally, at least for now. Its not a bad language, but its not a great one either. In the years since (and some would even say prior to) it's creation, more practical and elegant solutions have been devised to many of the issues it was created to address. There are certainly better Object-oriented languages than C++. There are certainly better Procedural, Functional and Aspect-Oriented languages as well. Where those languages typically "fail", is that they support one paradigm really well at the expense of the others -- C++, on the other hand, is generally considered to be a multi-paradigm language: It doesn't reign over any one paradigm, but it can do them all with varying levels of effort and success.

Its a bit like you're going on a trip abroad and need to hire a translator. If you're just visiting France, it makes sense to hire someone fluent in French -- but if you're taking a trip across Europe, it makes more sense to hire a translator who, while not fluent any one of the languages in question, speaks them all well enough. Sometimes you can't, for various reasons, hire a new translator for every region you visit. The same is often true in the professional software world -- most of the time you can't choose the best language for the job with each new project. This, combined with easy migration from C, is why C++ is the dominant language today, in my opinion.


Which language is best for a beginner though? Its hard to say. I'll go out on a very short limb and say that its not C++. Its simply not a language which has a scope that's fit for a beginner. Personally, I went from C to C++, and had prior experience with various BASIC dialects. This was a fit for me because I'm the type of person who likes to learn from the bottom up. For those more inclined to the top-down approach, C# will probably provide more immediate satisfaction. In either case, C++ will have to be learned down the road if you intend to pursue programming professionally. Even if you don't end up using it as your primary language, its position as a very popular, multi-paradigm language has essentially made it the language of the masses, so even if you do not write it, you still must be able to read and understand it.

throw table_exception("(? ???)? ? ???");

Quote:Original post by ravyne2001
On the other hand, C is a great language to learn how the computer works as a machine


No it isn't. C is an abstraction like every other language and has very to do with how the computer works as a machine. There have been numerous posts by myself an others about this misconception. There is one language that will help you learn how the computer works as a machine and it's the appropriate assembly language.

C is useful because there is a C compiler on virtually every platform you can imagine and because its runtime is very small. Very few other languages can make this claim (Forth comes to mind).
Okay from what I have read, and thank EVERYONE that has replied for their replys again I really appreciate your time.

I should learn C# for the time being because it is the easiest language to start out with, then move on to C++ for game dev, and knowing some C would be good on the side.

What would be the preferred C# compiler?
Should I start learning C# from the workshop you guys have here ?

Thanks in advanced again.

This topic is closed to new replies.

Advertisement