Why we choose CSharp over other languages ?

Posted by

.Net features

Image credit:commons.wikimedia.org

Why we choose CSharp over other languages because:

C# is better than C++ in that:
It’s native garbage-collection.
It lets you treat class-methods’ signatures as free functions (i.e. ignoring the statically typed this pointer argument), & hence generate more dynamic & flexible relationships between classes. edit in case you don’t know what this means, then try assigning a member method returning void & accepting void to a void (*ptr)() variable. C# delegates over the this pointer with them, but the user doesn’t always must care about that. They can assign a void() method of any class to any other void() delegate.
It’s a sizable standard library with a lot useful stuff that is well-implemented & simple to make use of.
It allows for both managed & native code blocks.
Assembly versioning basically treatment DLL hell issues.
You can set classes, methods & fields to be assembly-internal (which means they are obtainable from anywhere within the DLL they are declared in, but not from other assemblies).

C# is better than Java in that:
In lieu of lots of noise (EJB, private static class implementations, etc) you get elegant & friendly native constructs such as Properties & Events.
You have actual generics (not the bad casting joke that Java calls generics), & you can perform reflection on them.
It supports native resource-management idioms (the using statement). Java 7 is also going to support this, but C# has had it for a way longer time.
It doesn’t have checked exceptions 🙂 (debatable whether this is nice or bad)
It is deeply integrated with Windows, if that is what you need.
It’s Lambdas & LINQ, therefore supporting a little amount of functional programming.
It allows for both generic covariance & contravariance explicitly.
It’s dynamic variables, in case you need them.
Better enumeration support, with the yield statement.
It lets you define new value (or non-reference) types.

Facebook Comments

Syed Adeel Ahmed
Analyst, Programmer, Educationist and Blogger at Technofranchise
Computer Systems Engineer from Sir Syed University Of Engineering & Technology.I am passionate about all types of programming.
Syed Adeel Ahmed on FacebookSyed Adeel Ahmed on GoogleSyed Adeel Ahmed on InstagramSyed Adeel Ahmed on Twitter