DEV Community

Is C# worth learning in 2019?

Dayvster 🌊 on November 19, 2019

Well is .NET still worth learning in 2019? The short and boring answer would be, yes. But I assume you're not here for a quick and borin...
Collapse
 
jwp profile image
John Peters

Growing up on .NET, I became a bit biased. I love C# and ASP.NET core. In the meantime Angular and React took over the front-end world, and Node and Express are working to create the Isomorphic stack. If I were a new programmer I'd skip C# and Java and learn server side Javascript using Node and Express.

Collapse
 
yerac profile image
Rich

server side Javascript

This still sends chills down my spine whenever I hear it!

Collapse
 
jwp profile image
John Peters • Edited

Ya, I'm sure, just like we (C# and Java people) laughed at Javascript back in 1990.

Collapse
 
dayvster profile image
Dayvster 🌊 • Edited

While I can see where you are coming from, I have to point out that the always async nature of Node.js is a pretty big issue for beginners, furthere more I personally find that Nuget packages are much better maintained and in better hands than the vast majority of npm packages.

Especially when we consider that the most important nuget packages are all created and maintained by Microsoft themselves, whereas NPM packages are mostly created and maintained by random developers that can stop maintaining or cause comparability issues for various reasons.

Collapse
 
seanmclem profile image
Seanmclem

As a long-time user of .Net and recent JavaScript full stack developer with node, it is my opinion that nuget packages are pretty difficult to work with compared to npm packages. These days there are a greater variety of simpler to use npm packages than there are nuget packages. Again, just my personal experience

Thread Thread
 
dayvster profile image
Dayvster 🌊

I actually wrote an article covering this very topic over here: dev.to/arctekdev/the-contenders-202d

While it's true that NPM has a greater choice of packages they are all for the most part maintained by third party developers. This means that at any given moment a spat between two developers could cause conflicts between their packages, or the package you relly on could simply stop being maintained all together, or completely changed for no reason at all.

On the otherhand you have fewer choices with nuget but a large portion of the most important nuget packages are maintained and created by Microsoft themselves, meaning that you have a greater sense of stability and trust that those packages will exist and function as intended for the next 10+ years.

Thread Thread
 
mateiadrielrafael profile image
Matei Adriel

Most big npm packages have a team of multiple devs behind them. Also, the async stuff from nodejs was inpired by c# (async / await)

Thread Thread
 
jwp profile image
John Peters

Matei, very interesting! Tx.

Collapse
 
jwp profile image
John Peters

Artec wrote "important nuget packages are maintained and created by Microsoft themselves, meaning that you have a greater sense of stability and trust that those packages will exist and function as intended for the next 10+ years."

All true as long as MSFT doesn't throw us under the bus. Like they did for SilverLight, WPF (which was never completed), their ridiculous fractured desktop environment (UWP) and now .NET. Sure .NET Core is going to be good, but didn't Java say in 1991 (build once run anywhere)? Microsoft just learned that lesson starting with their .NET Core concept a few years ago ~

Collapse
 
nstefan profile image
n-stefan • Edited

Whyever?

Latest TechEmpower results as of the time of posting this:
techempower.com/benchmarks/#sectio...
As you can see, Node.js is so far behind ASP.NET Core in all tests, it's not even a contest any more.

As for front-end C#, here's an example: n-stefan.github.io/diabloblazor
It is a port of this: d07riv.github.io/diabloweb
replacing React/JavaScript with Blazor/C#.
Being static it doesn't use a server at all, but server side prerendering (initial rendering) is baked into Blazor and can be used with sites that are hosted by an ASP.NET Core server. There's also server side Blazor, which doesn't need WebAssembly and still behaves like a SPA/PWA - no full page reloads, uses differential rendering, etc.

Edit: added further benchmarks
.NET Core/C# wins 10/10 tests vs OpenJDK/Java:
benchmarksgame-team.pages.debian.n...
At the same time OpenJDK/Java wins 9/10 tests vs Node.js/JavaScript:
benchmarksgame-team.pages.debian.n...

It should be noted that both the TechEmpower tests and these benchmarks were run on Linux. On Windows .NET Core/C# would likely be even faster.

Collapse
 
mustapha profile image
Mustapha Aouas • Edited

It's BLAZINGLY fast
And I mean FAST, it still outperforms Java, NodeJS and most of the competition

Do you have some benchmarks between C# (asp) and node.js ?

Collapse
 
dayvster profile image
Dayvster 🌊

No, nor should you worry too much about benchmarks between languages/platforms/frameworks and so on.

They are one of many matrics.

I cover this exact thing in my other post: dev.to/arctekdev/the-contenders-202d

Where I discuss how small percentage differences in resource usage usually do not matter when you are developing out in the real world, because no developer always writes perfect code in a perfect way. And even if they do that developer would be a lot more expensive per year than simply buying a new server.

Collapse
 
mustapha profile image
Mustapha Aouas

I'm just trying to find what makes you say that it outperforms Node?

Thread Thread
 
dayvster profile image
Dayvster 🌊 • Edited

You are not listening, focusing on benchmarks and it's minimal performance differences is not a good idea as it's an unimportant metric in most cases.

But if you wish: ageofascent.com/2019/02/04/asp-net...

techempower.com/benchmarks/#sectio...

This one is a year old and I'll go out on a limb and assume not too much has changed in a single year.

As you can clearly see .NET outperforms NodeJS in most categories.

Not a surprising result to be perfectly fair.

Thread Thread
 
mustapha profile image
Mustapha Aouas • Edited

Stop being condescending please. I don't care that much about benchmarks but I'm looking for the proof behind what you said:

It's BLAZINGLY fast
And I mean FAST, it still outperforms Java, NodeJS and most of the competition

Btw, are we not seeing the same result or something? because it seems that it's quite the contrary, we clearly see that node outperforms aspnet on must of the benchmarks, here's one (of many) as an example:

node outperforming aspnet

Multiple queries benchmark (higher is better)
Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
sketchydev profile image
Shane Booth • Edited

If we take Round 18 from TechEmpower and adjust the filters to add aspnetcore we get some different results which are very much in favour of aspnetcore

Thread Thread
 
dayvster profile image
Dayvster 🌊

Shane Booth I'd recommend not feeding the troll much more, he appears to be a bad faith actor.

Thread Thread
 
sketchydev profile image
Shane Booth

Agreed - i'll leave it there :)

Thread Thread
 
mustapha profile image
Mustapha Aouas • Edited

I politely asked you to give some proof, how does that make me a troll ?

And how am i of bad faith since i used the link that you gave me?

Thread Thread
 
mateiadrielrafael profile image
Matei Adriel

Im pretty sure i saw some version of nodejs running on the jvm which outperformed c# in all categories but i cant find the link rn (when ill do ill post it here)

Thread Thread
 
algonzalez profile image
Al Gonzalez

What is faster is ASP.NET Core with Kestrel. Open the filters and enable "Kestrel" in the "Front-end server" section and then make sure "asp.net core" is enabled in the "Framework" section. Make sure to click on the "Apply changes" button.

Collapse
 
sketchydev profile image
Shane Booth

skylinetechnologies.com/Blog/Skyli... I'm struggling to find a more recent benchmark on nodejs vs net core, though.

Collapse
 
mateiadrielrafael profile image
Matei Adriel

Well, nodejs isnt that great for heavu computations, but its awesome when talking about a lot of concurrent requests

Thread Thread
 
sketchydev profile image
Shane Booth

NodeJS is good for multiple requests, no doubt about it, the benchmarks on TechEmpower(which are linked to in other comments)do suggest that netcore is more performant however. But then again, performance alone shouldn't be the deciding factor on choosing a tech stack.

Collapse
 
dayvster profile image
Dayvster 🌊

I suppose I could try running some when I get home, that is if I don't have too busy of a day at the office.

Basically saying no promises but I'll try and keep it in mind.

Thread Thread
 
nospower profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Jon Knowles

I normally never reply to any posts online, but wanted to say thanks for this article. To the troll: if you don't agree with the post, read something else, or watch some porn and you'll feel much better

Collapse
 
aethelflaed profile image
@_Geoffroy

the only languages that can boast about being more resource friendly and therefore fast would be
C, and C++. However, their speed and performance come at a price. In both of them, you have to take care of memory management and trash collection yourself.

In C++ you can take care of that yourself, or you can use dedicated smart pointers, which takes care of it for you.

And it would be nice to note that only the .Net core is available for Linux. You can be as experienced as you want, but you'll still have problem finding jobs because of the confusion between the core and the framework. IMO that's on purpose, so it's really a bit far-fetched to say it works on Linux...

The programming language with the basic library? Yeah. The whole system? Certainly not.

Collapse
 
mburszley profile image
Maximilian Burszley • Edited

that's on purpose

Why do you feel that? The project started out as providing a core framework that works across all platforms. .NET Framework is being sunset in favor of .NET Core (and post-2020, just .NET 5+)

you'll still have problem finding jobs

Jobs are a-plenty depending on your market. No, they're probably not in Silicon Valley startups where everyone's on the js binge, but in other markets, the positions are flourishing (surprisingly to me, the Midwest).

The programming language with the basic library? Yeah. The whole system? Certainly not.

What do you feel C#/.NET are missing? Your comment is missing a lot of context.

Collapse
 
mburszley profile image
Maximilian Burszley

The entire .NET Framework has been ported into .NET Core

Before 3.x which just released a month ago, this was plain not true. You did not have access to various GUI frameworks and some more niche items.

all knowledge of .NET Framework is transferable to .NET Core

Also missing nuance. If your workflow was using Visual Studio for everything, you didn't have much knowledge of cli tools. Using the cli can be pretty important for .NET Core.

Collapse
 
jonasbarka profile image
Jonas Barkå

Javascript in Unity (Unity script) has been deprecated since 2017. C# is the only official scripting language, at least until the planned visual scripting is released.

Collapse
 
dayvster profile image
Dayvster 🌊

Really? I haven't developed/played with Unity in ages. I was not aware of this.

Collapse
 
daniel15 profile image
Daniel Lo Nigro • Edited

only languages that can boast about being more resource friendly and therefore fast would be C, and C++.

For what it's worth, the .NET Core team have started rewriting some of their C++ code into C#, which in some cases has actually made it faster.

A lot of that speedup is due to being able to avoid marshaling data between managed (C#) and unmanaged (C++), but it's still worth noting that just because some code is written in C++, doesn't mean it's faster than C#. The C# JIT can do some advanced optimizations at runtime that aren't possible with a language that compiles directly to machine code with no JIT compilation.

The Kestrel web server for .NET Core is faster than both Nginx and Node.js, even though Nginx is written in C while Kestrel is written in C#. techempower.com/benchmarks/#sectio...

Collapse
 
hnnx profile image
Nejc

Short version: Yes

Collapse
 
dayvster profile image
Dayvster 🌊

That's about the jist of it yea.

I often get asked by other developers or better yet accused of working on legacy software or webapps when I mention that I'm a dotnet developer.

Collapse
 
mburszley profile image
Maximilian Burszley

.NET Core 3.x 😎

Wonderful improvements

Collapse
 
maxiakovliev profile image
Max

Actually ASP.net core really outperform Node.js:
here is proof link:
techempower.com/benchmarks/#sectio...

Collapse
 
sakko profile image
SaKKo

I never used .NET in any of my project so in my opinion it's not really about the language. There are many other alternatives, and you should choose them according to your need. Nodejs, ruby, python, c#, etc..., they are all have the good and the bad.

Collapse
 
dayvster profile image
Dayvster 🌊 • Edited

I fully and whole heartedly agree with that sentiment.

There is the right tool for every job. However with languages like C# and Java that have a high level of flexibility in terms of where you can use them and what you can create with them. The golden hammer problem becomes more and more likely.

That is that with a golden hammer every problem becomes a nail in your mind and you only wish to use your shiny golden hammer.

I usually like to steer clear of tribal language/framework/library arguments and comparissons and instead like to simply highlight differences between the languages themselves.

I found that this makes people focus a lot less on asking "what's better" and a lot more on asking "what would I rather use" or "what would suit my needs better at this moment"

EDIT: Sorry for the wall of text. I try to avoid them as much as possible.

Collapse
 
mateiadrielrafael profile image
Matei Adriel • Edited

I mean, for me personally the golden hammer is nodejs w typescript

 
aethelflaed profile image
@_Geoffroy

Hey, I precised it was my opinion, and didn't try to say anything negative, I was just surprise to see this post as #opensource and was reacting with the best of my knowledge, without trying to be rude with anyone.

If I can't comment anything, what's the point of commenting anything at all?

And it's really not like I hijacked another comment thread, I started a new one, so really, why are you so butt-hurt?

Read my post again, with the knowledge that I didn't know about this new release, and you'll clearly see that I'm not really criticizing anything, just commenting about something that was clearly my own opinion (as expressed by the common idiom "IMO"), and as soon as I learned about my lack of knowledge on this subject and my actual error, I expressed it also.

So now if you don't want people to express any kind of opinion at all, why are you even on internet?

Collapse
 
hte305 profile image
Ha Tuan Em

I love C#. Because it's easy for building application to QUICKLY. At the moment, I am building cross-platform with .Net Core for server (maybe Restful API or GraphQL) and React client for web, React Native for native mobile app. It's very useful.

Collapse
 
ryanthedev profile image
ryanthedev

Java is horrible. I'm a full time Sprint boot webflux Java dev and asp.net core dev. I have also built production apps in angular/react with a node backend.

Unless Java creates an async await keyword, it's not worth it.

.net core has been on fire. If you care about performance and don't want to roll Go, go .net core.

Collapse
 
pareshjoshi profile image
Paresh

If you think it will add value to your career** (this is very subjective though) and the community, then yes, it is worth learning. I have 12 years of experience as C# Developer and have seen evolution of C# during these years. There are many resources available and the language is easy to learn. That said, we shouldn't compare it with other languages, as there is no one size fits for all. For example, Python has more tools available for ML and golang is being adopted widely for distributed systems. As Industry is moving more towards API-first approach, I believe, we now have more choices on selecting right language for right task. Apps can be built all in C# or mix of multiple languages.

To conclude, I agree - C# is worth learning in 2019, 2020, 2021 and for next few years to come.

Collapse
 
manning0218 profile image
Brandon Manning

It should be noted that modern c++ makes memory management a lot easier with the use of smart pointers. I know it's been a part of boost, but being part of the standard is much more convenient. I think C# is still a great language, but that price to pay to use c++ more has to do with not having as many built in libraries. And with vulkan, low level development for graphics is becoming big again. It really depends what you want to do with your career. I still see a lot more jobs for Java then .NET, but a lot of companies are now wanting to use golang.

Collapse
 
cyberprogs profile image
CyberProgs

I really don't like the way developers talking about single technology/tool as a golden hammer, I can't even imagine someone comparing C# to JavaScript, they are totally different, each one has its own purpose if you have heavy IO operation go with Node.js if you have complicated business and need a decent architecture go with C# ..etc

Collapse
 
aravindk profile image
Aravind Kothandaraman

Loved the comment about pun.... java dev's cant c sharp... 😁

Collapse
 
dayvster profile image
Dayvster 🌊

Woo I got a laugh. Time to put down the keyboard and hit the stages, always wanted to be a stand up comedy star

Collapse
 
rwing profile image
Rwing

Nice! Can I translate the article to chinese in my blog?

Collapse
 
dayvster profile image
Dayvster 🌊

I can't really expressly forbid that since well I won't know if you did it or not.

But personally I would recommend drawing inspiration from it and writing in your own style and way instead of a direct translation.

What I mean by that is you'll most likely see bigger success if you write your own. It can be similar but in your own personality.

People will feel connected to you as a writer more if you have a clear defined personality and writing style.

Collapse
 
rwing profile image
Rwing

Sorry for my bad english first, I just wanna post this article to chinese community because the .net technology market share in china getting less and less

 
jwp profile image
John Peters

True, but why?

 
jwp profile image
John Peters

Funny!

Collapse
 
makampos profile image
Matheus de Campos

Baita discussão em gente!

 
mburszley profile image
Maximilian Burszley

Sure, all you need to do, but you are not representative of all environments.

Thread Thread
 
jonasbarka profile image
Jonas Barkå

Sure there are new things you have to learn in Core, but that's no different than any other language or framework that gets updated.

The .Net Core CLI is very easy to learn if you need it.

And the main selling point of Linux support is not developing on Linux but for Linux.

Thread Thread
 
kaiserbergin profile image
Donovan Bergin

dotnet watch ftw

Thread Thread
 
aethelflaed profile image
@_Geoffroy

The entire .NET Framework has been ported into .NET Core which means nothing is missing. Many if not all of the most important libraries have also already been ported.

Something that happened a month ago for a tech that I don't use everyday is still something really new for me, I just learned about that; I spoke about my former experience with C#/.Net

I'm guessing the only reason why everything seems so unclear to you is because you have no interest in .NET. This is fine by the way, but stop spreading misinformation by acting like you know what you're talking about when you really don't.

It's not that I'm not interested, but if the information does not reach me, I'm not gonna know that - from what I've learned in this thread - C# may indeed be useful even if you target Linux.

My message was not intended to troll anyone, I just spoke my own opinion and point of view based on what I knew; it was not complicated to infer that I didn't know about the change in this last release, which is not clearly highlighted in the post.

Collapse
 
kryptosfr profile image
Nicolas Musset

Unity doesn't support JavaScript at all. It has a scripting language which syntax is inspired by ECMAScript but there is no way to use any JavaScript libraries with it.

Collapse
 
aaronfranke profile image
Aaron Franke

Unity does not support JavaScript anymore.