Difference between C# and C++??

I have searched the web for so many sites offering the differences between these two languages, and only have found that C# is not pronounced “C number” as I have but rather “C sharp.” All the other technical jargon is completely out of my noobish reach.

What is the difference in layman’s terms? If that is impossible, which would be better to do what?

My head is going to explode…

Heh, I use to think the same way.
There are many languages and much is personal preference but also some fit one job better than another, anyway here are a few links that might help your question.

C# is part of Microsoft’s .NET framework. The main difference is that it requires a virtual machine to work (sort of like JAVA) i.e. it doesn’t compile into native code.

C++ is a lower level language so it doesn’t have features of higher level programming such as automatic garbage collection and is more strict about syntax.

Use C# if you plan to use it only on Windows machines and speed is not an issue.

Use C++ if you need to do lower level programming, want something that is portable across multiple platforms, want to compile the source, or need something fast.

Personally, I would recommend C++. It forces you to learn good programming technique. (At least more so than C#)

I don’t program in either one of them, but from reading the links, it appears that C# supports programmers writing application programs much better than C++ does, but systems programmers who need to get down and dirty will need C++ to manage things that C# won’t allow.

C++ requires more work on the programmer’s part to manage memory. Other langauges (like C#) do this for you. I’ve never programmed in C# but I hear it’s very similar to Java.

Personally, I would recommend C++. It forces you to learn good programming technique. (At least more so than C#)

C++ doesn’t force you to do anything. You can code however you want, whether you want your code to be readible or sloppy. It’s not like Java which forces you to make everything an object or like Python, which forces you to indent everything.

I wasn’t speaking in regards to clean syntax. I just meant that when programming in C++, if you have to pay more attention to the overall structure and design. (You could say the same about any low-level language) Languages with VMs tend to be a bit more forgiving.

Ok, then. I’m looking for a good language for a game engine, hopefully like OGRE or DXStudio. At first, I hoped there would be a game engine that would have a more beginner friendly design, such as the Bethesda’s construction set for Oblivion and the GECK for Fallout 3. Anyway, I was starting to think C++ is a better choice. Anyone who wants to prove me wrong, say it now. Thanks for the replies.

Are you planing to write your own engine, or are you looking at using an opensource engine?

Microsoft bastardized java to the point where it no longer met the standards, so they renamed the language to C#.

Yeppers,
From Wikipedia, the free encyclopedia

C# (pronounced C Sharp) is a multi-paradigm programming language that encompasses functional, imperative, generic, object-oriented (class-based), and component-oriented programming disciplines. It was developed by Microsoft as part of the .NET initiative and later approved as a standard by ECMA (ECMA-334) and ISO (ISO/IEC 23270). C# is one of the 44 programming languages supported by the .NET Framework’s Common Language Runtime.
C# is intended to be a simple, modern, general-purpose, object-oriented programming language. Anders Hejlsberg, the designer of Delphi, leads the team which is developing C#. It has an object-oriented syntax based on C++ and is heavily influenced by other programming languages such as Delphi and Java. It was initially named Cool, which stood for “C like Object Oriented Language”. However, in July 2000, when Microsoft made the project public, the name of the programming language was given as C#. The most recent version of the language is 3.0 which was released in conjunction with the .NET Framework 3.5 in 2007. The next proposed version, 4.0, is in development.

What do those funky words mean? And how is that different from C++?

What you need to do is first determine what API you plan on using. That will have a big influence on what programming language you use. Specifically you need to look and see what language bindings are supported.

If an API has only C++ bindings, C# won’t do you much good. And vice versa.

You may even find that the API you decide to use has only bindings for something like C.

There are tools and methods for using bindings from other languages. For instance it’s not too hard to use C bindings from within C++.

But that’s not something you would want to have to mess with if you are just starting to learn programming,

Ok, if you want to learn to program the very best help you can get is based on how much support from others you will need if you plan to learn on your own. What I mean is I have been learning to program for about a year not counting all the research and DEAD ENDS to teaching yourself to program.

Here goes first it does not matter much which language you pick as in the end if you learn one you can figure out what the differences are, I am sure there are many who will disagree.

Anyway if you wish to learn C++ here is the best video teacher I have found so far.

And the next language I have found beginner support to be great is Java Greenfoot.
http://www.greenfoot.org/index.html

Now I am sure there are many other great teachers out on the web but I have yet to find them and I have a HUGE list of bookmarks on every language looking for solid steps to learning and still looking.

The bottom line is to learn programming you have to write code and not cut and paste you must type it to get it into your brain and their is always more than one way to code everything.

I hope this is helpful, also you might ask yourself what do you want your program to do? If you know what you are trying to accomplish that is very helpful, but if you just want to learn then follow the examples get a good understanding and see if you can find other ways of getting the same results.

Oh a note on programming tools or as programmers call them IDEs find ones that have good support and docs to teach you how to use them. And use the same IDE that a teacher is using in a Video.

There’s about a gajillion garbage collectors out there, IIRC boost has one along with their smart pointers, object factories and all that.

Basically, c++ is object orientated c. You can use regular c code within a c++ program and it will compile just fine under a c++ compiler–it just throws up a bunch of extra warnings since c++ is a lot stricter about pointer casts and stuff like that. I’ve even seen the suggestion to use the c++ compiler on c code for exactly this reason.

The other way around, c++ in a c program, needs some extra work since c doesn’t know about objects. I’ve seen people use a struct as a wrapper around all an object’s functions when using a c++ lib within a c program before so it isn’t impossible.

Don’t know about c# since I don’t do windows.

There’s a bunch of free game engine code out there to look at but I think almost all of it is in c or c++ with c being the preferred language from what I’ve seen for speed reasons.

C#: managed code, garbage-collected, interpreted + just-in-time compilers. Object-oriented. General-purpose-driven with a business bent. There are of course bindings for GL and DX, but they happen to be wrappers to a point, so they’re slower. Memory management is automatic. Less multimedia libraries written for it (unless you’re ready to pay top buck).

C++: with greater power comes great responsibility: you choose your own code organization methods, you play with the syntax, you pick a memory management method. Object-oriented + procedural. Most compilers with let you even insert machine-code equivalents (asm extensions). Meant as a systems programming language. Properly written programs will fly. GL and DX native bindings, thousands of open media libraries and several game engines (such as Ogre) written for it. It still dominates the game programming scene. The most successful programming language ever, the more likely one to get you a less boring job, and the one that’d let you tweak Blender code.

Hope that helps. :wink: