I’m currently looking into learning a programming language for personal use and for advances in different degree courses, and I want to make sure that I learn the right languages at the right time.
Currently, my question is this: What is the difference between C, C++ and C#? The course I am looking at offers C or C++ and Unity uses C#, so I might learn C# first, but I don’t actually know the differences.
Can anyone explain these in simple-ish terms? (I haven’t looked into programming specifics yet)
If your looking for learning the language just learn any language by taking proper classes and then watch tutorials of other languages online there is noo big difference in any language I mean just few differences if you know about any language you can just learn easliy by seeing guide or video tutorials online … My point is to start learning langugage just take a proper class of any language then u will be able to learn any language easily
C (and C++) are very detailed… but they also have a huge ability to hurt you. Think of a surgeons scalpel.
C++ is C with a whole lot of stuff added. It makes writing good code easier (e.g. OO), but is also insanely complicated.
C# is like a butchers knife. Very powerful, and gets the job done. You don’t need 12 years of schooling to become proficient (as a surgeon would) but it’s not great at open heart surgery.
Given your into making games with unity, C# is the obvious choice.
C was the original language it is totally procedural and not object oriented. C++ (which was originally just called C with objects) is just that an object oriented version of C with a standard library thrown in. C# is a version of C developed by Microsoft to be more clean and modern than C++ while attempting to maintain the power of C and C++.
Btw Object oriented basically means you have classes which are nice constructs used to manage code.
C is the most low level (closest to actual binary) of the three languages and still has many uses notibly all current OS are written primarly in C.
C++ is higher level than C and is a standard for writing game engines and other high performance applications where speed is a critical issue.
C# is the highest level and has a multitude of uses it is slightly slower than the other two but is much easier to use (Imo) which is probably going to be more important for most of the things you are likely to do (assuming your using it for personal use).
You have to do allot of lower level things in C and C++ like manage dynamic memory which is actually a bad idea all around considering that most modern garbage cleaners will do it more efficiently than human coders. (If you don’t know managing dynamic memory is just think of it as a pain)
This comes from someone who learned a little C first then C++ and finally C#. But if you know any of the three languages you will pick up the other two quite easily.
Actually c/c++ is hard, c# is easier. C++ is industry’s standard. It will never run out. Personally if you think you are going to write your own engine, and stuff, C++ is the way to go. C for gaming not so popular because it’s not oop. C# is good but you have to stick to the .Net framework which can be troublesome when porting games from win to osx or linux or mobile or vice versa.
To put in short. If you are going to stick with Unity for some time. Learn C#. It’s faster than learning c++ but if you see yourself writing game engine, then use C++.
But same rules still applies. The concept of OOP is the same. Only difference will be the workflow. Personally i am not so fond of writing a code, compile and write and compile. A little time consuming, And i prefer Unity’s workflow.
Yes C# is the easiest to use that is what I said. When I say low or high level I am referring to the amount of abstraction layers not the difficulty to code in. Higher level languages are generally easier to code in and less efficient to run.
There is no reason to learn C++ first if its not where you will spend the majority of time in, as you would learn a lot of stuff that was dropped in modern languages for multiple reasons (primary ones like more productive, saver, cleaner, clearer)
I personally would recommend to learn C# as you can use it outside of unity and as you find hundreds of books and ten thousands of tutorials on it. UnityScript on the other hand stops to exist at the borders of unity
Ok, thanks guys
I’m going to stick with C# for now, considering the course I want teaches C++ but that’s not for a couple of years yet, and I’m taking decision maths at A-level for the next year followed by further maths after, so I should be set up.
I would learn C++ myself. If you want to go into games programming as mentioned above it’s the industry standard. If you become proficient in C++ and find yourself in a position where you are required to use c# you will find the transition very easy.
As you mention the course teaches C++ then you will also giving yourself a head start.
If you do some simple games in c++ and open GL you will be learning alot of fundamental stuff that will give you a solid understanding of whats going on under the hood that will serve you in good stead, especially if you plan on going into programming as a career.
I agree. Learn C or C++ first. The benefit of starting with C/C++ is that they are very strict and very touchy. You have to learn the proper way to do things or it won’t work. With C#, as with all languages, you can do something many ways. One might say, “You SHOULD do it THIS way.” In C/C++ that SHOULD becomes a MUST. So if you learn C/C++ first, you will learn how to do things properly from the beginning, which makes coding well in any other language considerably easier.
By the way, OOP is not a per language thing. It’s one of the original design patterns. You can use C in an object oriented fashion. It’s just that C++, et al were designed with OOP in mind which allowed their creators to add more features that built on the paradigm. And C is still very much an industry standard, especially in embedded systems. Its straightforward approach and light weight pretty much guarantee it’s not going anywhere soon.
haha. Yea, in any way what can be shared from C ( almost nothing with C++ expansion ) to C# is so basic it doesn’t really matter which one your looking into. If your interested in programming go ahead and take the class. If your starting from no programming background it doesn’t really matter what language your learning as much that you understand how to accomplish tasks.
But i have to warn you people who know C# very well still cannot jump into unity. Your going to be taking on multiple tasks once you get started with unity and even more than the scripting language you choose the most important thing will end up being your understanding of mathematics and physics. While some games won’t require you to know that much 3D math, like say you were doing a card game you’ll still end up needing to understand it to say move a card around.
C/C++ are valuable to learn if your going into games in general. While i love using unity, and its very fast for what it does you do loose a-lot using a managed/scripted language. And with .net seemingly falling apart with the vast support of HTML5 who knows how much longer having .net support will be viewed as a positive vs. alternatives.
Then you’ll be fine. I’d highly recommend just starting off in unity then, otherwise i’d say to do a console or window forms app because it can be frustrating to try and learn physics while programming.
Try and see if you can use a tutorial or demo from unity, modifying something to work differently and you’ll pick up on C# pretty quick. It can be valuable to go through some language tutorials though too.
I’ve taught myself the basics of a half dozen languages since I began coding (<3 years ago). Each one presented a completely different viewpoint, and gave me a better grounding in the concepts.
Right now, stick with unity and C# - but learn BOTH!
People often learn just enough C# for unity… but don’t bother learning all the powerful aspects of C# (Or vice versa, people not using Cor-routines properly)!
I do 50% of my R&D in unity3d, 50% in Console applications (VS).