Friday, July 31, 2009

What's the difference between C++ and C#? Is visual C++ a different language or just a new IDE? What apps are

Are visual C++ and C# as distributed by Microsoft new languages or just new IDEs? What kind of applications are developed with each language? Which one should I learn if I want to make a computer game?

What's the difference between C++ and C#? Is visual C++ a different language or just a new IDE? What apps are
C is a high level language invented by Kernighan and Ritchie in the late 80s.





Originally Ritchie and some other guy were creating a language called "B" kind of like plan B suggesting that it would be the alternative language. "B" kind of sucked, so there came C. (There is also a D language out there that never gained much popularity, but it still has some diehard fans. There's even a C--.)





C++ is something of an Object Oriented extension of the C langauge (although it was still possible to do some OOP programming in classic C)





Visual C++ is not a new language.


It's just Microsoft's C++ environment.





C# is a different language. However, if you know C++ well, you should be able to make the transition to C# within an hour or so (they're THAT similar).





Some of the main differences are:


C# doesn't allow functions outside of classes.


The "using" statement has kind of replaced #include


Pointers are HIGHLY discouraged in C#. You have to mark your code as unsafe to use them.


C# does all its own memory management and "garbage collection". If you want to do any memory management in C#, you have to play some tricks.





Most professional videos games are written primarly in C++, but you should still be able to make a decent game in C#. You can still use DirectX and OpenGL in C#.





C# isn't so popular for games because - it's rarely used on non-Windows machines (you're not going to be doing C# for Playstation or Nintendo games).





C# does a lot behind the scenes for you. This is great if you're making an office application. Not so great if you are trying to squeeze every last bit of performance out of your machine. Games often require this kind of control, and C++ gives you more direct control than any other major high level language.
Reply:C++ preceded C#. C# is sort of a hybrid between C++ and Java that Microsoft came up with. C# comes with a framework and in theory eliminates the kind of memory problems that are issues when using older languages like C and C++. Visual C++ is an IDE offered by Microsoft.





All sorts of apps are developed using these such as front-end interfaces (GUI), web services, and Windows services. Computer games typically have very high performance requirements with regard to graphics so you usually end up operating with some low-level code. I would think this makes C++ preferable to C#. If you learn C++, C# will be pretty easy to pick up, but going from C# to C++ is going to be tougher IMO.
Reply:C++ and C# are languages developed by Microsoft which have similar backgrounds. They are both based on the original language of C. Thus they would possess similar jargon and procedures. However, they differ slightly in the manner of forming and calling functions, and many other commands.





In my opinion, I think C# is more powerful than C++. I have used C++ in creating a host of small programs. One of my colleagues used C# for his final year electrical engineering project and was able to do many things that I don't think is possible with C++. I would recommend C# if you want to make a computer game.
Reply:C# is like Java, except it was developed by Microsoft. C# compiles to MS's intermediate language, which can be platform independent (i.e. can run on Windows or Linux) as long as there's a .NET Common Language Runtime available for the platform (just like Java).





C++ on the other hand compiles straight to native code (i.e. binary) thats specific to a platform. Its also a bit harder to develop applications with C++ than it is with C#, as C# provides strong type-checking, garbage collection, and other features. C++ requires you to manage everything about your application, but can provide enormous performance over C# any day.





Visual C++ is an integrated development environment made by Microsoft to assist in development of Windows applications. There are other IDE's available, such as Borland C++.





As for your question on which language to use to develop games with, thats a toss up. On one hand, C++ will give performance, but is extremely difficult to develop games with. Its more of a personal preference really. I'd choose C# as there's now the XNA framework that Microsoft made to help developers create games.





Any kind of application can be developed with C++ and C#.





One final note: C++ can leverage the .NET framework, so you can gain the benefits of both worlds. Having the .NET framework provides a lot of common tasks that many applications need, such as developing window forms and database access to name a few.
Reply:Visual C was the C++ predecessor. As it's name implies, alot of C remains in C++. Although not actually being more powerful than C, C++ allows the programmer to more easily manage and operate with Objects, using an OOP (Object Oriented Programming) concept.The IDEs is somewhat consistent within both platforms. The difference is mainly design tools and many more plugins.


No comments:

Post a Comment