r/AskComputerScience • u/shadowoftheking14 • Apr 08 '17
Why is C# with the .NET framework so popular?
I've looked at many job postings and I've noticed that this is a highly desired skill. Why is that?
6
u/Randolpho Apr 09 '17
It's a really good language with a really good base library and lots of really great tools and third party libraries, but the main reason it's popular for jobs is the same reason Java remains popular with certain companies -- inertia. Once a platform is established with a mid to large sized company, it's really hard to switch.
2
u/dxk3355 Apr 09 '17
No one ever got fired for suggesting that they use Microsofts programming platform when using Microsoft desktops and servers.
-2
u/Technohazard Apr 09 '17 edited Apr 13 '17
Unity. It's used for game development and gamelike projects, and it's built on C# and .NET.
Edit: why am I being downvoted?
-7
u/hemenex Apr 09 '17
I don't get it neither. It's from Microsoft, Windows platform only and no obvious benefits over alternatives. This all makes it seem like developers might rather choose Java, C++/Qt or a ton of other more practical combinations. C# has very limited usability.
8
u/ACoderGirl Apr 09 '17
C# isn't Windows only. I mean, heck, think about Xamarin as the obvious example, which runs on all the big platforms, including Android and iOS. There's certain libraries that are Windows only, but not the language itself, nor .NET in general (not the core, anyway). Here's the official Linux installation guide, for example.
And "no obvious benefits over alternatives"? You've clearly never used C#! As someone who used it and Java extensively, my god, there's no competition. Java feels horrible after using C# for a while. It's a vastly better designed language that is much more enjoyable to use and will boost productivity due to its extra features. That's a pretty big reason to use it. I mean, certainly myself, I'd pick a C# company over a Java company, all things equal. It's my second favourite language to use, after Scala (and companies using Scala are way rarer). Honestly, it's almost laughable that you think C++/Qt is a more practical combination.
Also, even when using Windows only, that's entirely reasonable for a great deal of people. You don't need multiplatform support for a server application (which is by far the most popular use for C# and .NET). Plenty of other kinds of applications simply don't need cross platform support or it flat out doesn't make sense to have.
1
u/hemenex Apr 09 '17
Well, thanks for enlightenment. Do you have some experience with it on Linux? How feasible would it be to try to build multi-platform application in it?
Personally, I had to use Visual Studio a few times and I did not like it at all, which is probably what keeps me disgusted from developing on anything Microsoft. I understand it would be stupid to not use VS for C#.
7
u/SSID_Vicious Apr 09 '17
Visual studio is literally the best ide available. Only IntelliJ comes close.
6
u/WaxyChocolate Apr 09 '17 edited Apr 09 '17
Visual studio is literally the best ide available.
Actually IMO, I'd say Visual Studio with ReSharper is where it's at. (Made by the same people as IntelliJ).
2
u/Randolpho Apr 09 '17
Visual Studio keeps adopting the features of ReSharper, but ReSharper keeps adding new ones.
I rather like that.
2
u/Randolpho Apr 09 '17
Wholeheartedly agree.
Although I sometimes swap between Visual Studio and WebStorm, which is basically IntellJ for HTML/Javascript, when I'm noding rather than .NETing. I like WebStorm's intellisense for Javascript way better than I like Visual Studio's.
The same company (Jet Brains) has an upcoming C# IDE called Rider. It's still in the alpha stage, but if you are one of the few who like C# while prefering the general IDE approach of IntelliJ, it might be worth a look.
0
Apr 08 '17
[deleted]
8
u/WaxyChocolate Apr 09 '17
Because c# is more popular than PHP or Java
That's like answering "because it has a lot of water in it" when asked why the oceans are so big.
5
16
u/programmer_for_hire Apr 09 '17
In my experience (mostly C, Python, C#, x86 assembly, C++, VBA, Java, in that order, and with Java on the list meaning "I wrote 50 lines of code one time), I see C# as popular among myself and my coworkers for the following reasons (and they may be simply perceived merits, rather than objectively true):
-It's easy. C# does a lot for you out of the box, with easily understood syntax, good documentation, "safety rails" (see next bullet), and a strong standard library. Most things you want to do, C# does easily and safely. This saves your company money and time, as well as enables hiring a broader class of programmers (i.e less-skilled individuals become feasible hires).
-Built-in Safety Generally speaking, C# does a lot to make things safe for developers. The memory management is pretty good; manual memory management is pretty limited and there are good examples of most situations on the web.
-Good standard library. The standard library is pretty well-stocked, and covers many scenarios (from nitty implementation details to larger design patterns and system architectures).
-Unmanaged-code friendly. Although very safe out of the box, if you want to do low-level things, you can disable some of the safety checks in C#, or just marshall straight into an unmanaged code layer (like C++) and have more fine-tuned control over your machine.
-Everyone else is using it. Now the windup time for new employees has decreased, and their ability to make career moves has increased (as their skillset is in demand). Both parties are advantaged.
I don't know enough about Java to understand why C# has been gaining popularity over it. Personally, I found Java too verbose (not that C# isn't), as well as difficult to read (I was a C programmer at the time). Hopefully someone with more experience can provide more insight.