Link to home
Start Free TrialLog in
Avatar of Easwaran Paramasivam
Easwaran ParamasivamFlag for India

asked on

Why do we need C#?

It was asked why do we need C# language?  Could you please describe experts?

What are the disadvantages of languages prior to C#? How C# does overcome them?
Avatar of Cluskitt
Cluskitt
Flag of Portugal image

It completely depends on what your project is, what your needs are and what your knowledge is. There are way too many languages to make a straight-forward comparison, but you can try to look into these links:
http://en.wikipedia.org/wiki/Comparison_of_programming_languages
http://cplus.about.com/od/introductiontoprogramming/a/comparelangs.htm
http://www.jvoegele.com/software/langcomp.html

That being said, unless you have some very specific needs, you don't really NEED C#. Normal apps, like a DB front-end, etc, can be done in multiple languages. Again, it's mostly about your needs and knowledge (and budget, in some cases).
CUZ WE JUS DO LOL LOL

as above said...it depends on the project or the needs of the software....but C is the basis of alot of programs including windows at a point
Avatar of TI2Heaven
TI2Heaven

Microsoft has deprecated all other language but c++, javascript,  and NET language (c#,VB.NET, ...). So it assumed that community working with Microsoft technologies had made the change.
New developments with Microsoft technologies should use language that support from Microsoft is still available.
One point that should be made is that C# is kinda like VC++ adapted to the .Net framework. All the new .Net languages have inbuilt support to this framework. Also, in a sense, it IS an upgrade (not in all cases, but mostly) to the previous language.
@Cluskitt, C++ CLI avaliable.
It was my understanding that C# is a (sort of) upgrade from VC++, which isn't the same as C++. I may be wrong, though.
No.
C# it was designed to be very similar to c++, but they needed to add some syntax to make use of al features.
There is a new c++ standard on the way a Microsoft will update its language to comply with the standard.
The new c++ standard cover most of the syntax needed to make use of CLR features, but not all.
Avatar of kaufmed
C# it was designed to be very similar to c++
By that I hope you mean in syntax. C# is closer to Java than C++.
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
@jaime_olivares
Delta expressions
Did you mean "lambda" expressions?

Anonymous delegates
Isn't a function pointer effectively the same thing?

Unsafe mode
Would it not be fair to say that the whole of C++ is "unsafe mode"?
Avatar of Easwaran Paramasivam

ASKER

Thanks.
@kaufmed, you are right! it is lambda. I was writting very fast.
Anonymous delegates are not the same, because they can be used inline without declaring a function.
Yes, C++ runs basically in unsafe mode, but C# can work on a mixed mode (managed and unsafe) even on the same method.
C++ and C were creating security problems because of their use of pointers. So Microsoft decided to forbid pointers in .NET (managed code).

Java was already a language that was similar to C++ without pointers, and that could have solved the problem. But Java is not optimized for any platform and thus has limitations in most operating systems, including Windows. A few years ago, Microsoft tried to create a "Java for Windows" called J++. But Sun, that had the rights to Java at that time, prevented them to do so.

C# is the answer to those problems. A language similar to C++ that has all the good features of C++, without the bad ones (pointers, multiple inheritance), and that has the main feature of Java (multi-platform) while being optimized for Windows.
A few years ago, Microsoft tried to create a "Java for Windows" called J++.
I thought it was called "J#". Was there a "J++"?

[edit]Never mind. Apparently there was both.[/edit]
@jaime_olivares,
I am not agree with you. All the features you give in your post are not c# features, they are IL Net features. Some of the features you describe are imperative for any language with support for CLR engine (garbage collector), so C++ CLI have it.
You need to take a look to last standard, not implemented yet by any one. I don’t understand why people think there must be a unique alternative that is best, can’t be even alternatives?.
I do believe that VB.NET and C# are even alternatives for programming in NET framework. Some people like me will prefer the verboseness of VB.NET and other will prefer the sharpness of C#.
There is something that everybody is missing with the new C++ you might lose access to some of the IL Net features but you can program almost in any machine or environment.
@JamesBurger,
C# is the answer to those problems
How old are you?, there is not a definitive answer in IT. Problems only show up when anyone “have a solution”.
@All,
This question was not fair because the person who asked was in the side of c# lovers.
T!2Heaven,
Please read carefully, it stated "c# versus pure C++".
Regarding C++/CLI,  try to write a lambda expression, use Linq, extension methods or the dynamic operator with C++/CLI (please add them to my list above), and tell me it is the same in C++/CLI because all them are IL features.
There are idiomatic expressions in C# that are exclusive to C#. In some cases, they are incorporated lately in other languages (this has happened recurrently with VB.net) but it doesn't look as readable as with C#, which is, btw, a native .net language, not an adapted language.
Jaime.
I didn’t say that c++ CLI has support for all the features of the IL.
but it doesn't look as readable as with C#
That is another opinion.
a native .net language
Can you give me a link where Microsoft stated what you are saying? (Please…. ;-))
not an adapted language
All programming languages are always adapting its syntax to new required expression. A language is just a set of syntax rules; don’t give a language more importance that it really has.
The component that might make the difference between NET languages is the compiler (language->IL)

Ten un buen día! ;-)))))))))))))
Thanks for sharing your opinions about my opinions.
@kaufmed

J++ came somewhere at the beginning or middle of the 90s as a "Java for Windows". But Sun slammed Microsoft in court, and it was removed from the market a couple of years later.

J# came with the first versions of .NET as a way to lure Java programmers to Visual Studio. But it never really catched on (with C# being so close to Java) and Microsoft stopped shipping it with VS in 2008 or 2010. My understanding is that it is still supported however.