I have been developing in .Net MVC 5 and now the last 6 months in .Net Core 2.1. Core is pretty awesome, I would say the learning curve is pretty high, but I'm very satisfied. Previously, I used Java in school. The .Net stack offers a lot of jobs in enterprise companies, if you are someone that dislikes SV mindset.
Also, Visual Studio is an insane IDE. Although, I recently did have some nasty bugs but updates are coming out pretty quickly.
As a recruiter, I have to say that .Net is still used by startups, especially in Europe and cities like Manhattan with a large European population. I am shamefully plugging the fact that I am recruiting for said roles :-)
If you had to rank and list the top rough spots in the transition, what would they be? Entity-Framework changes are often cited, but what else is different enough?
What's crazy is that this is what C# should have always been. I was into Mono way back because I thought niavely it was going to be more successful, but I think if C# had gone this route earlier -> the whole python / go etc popularity boom might have been softer and MS would have had a first class player that would have increase # of folks easily able to build in windows.
That and I never got to develop successfully beyond Forms - which I wish was not in preview from designer standpoint. I know old tech, but frankly for older programmers I find it easier and quicker to get stuff up with.
I’ve thought about this but I doubt it. The big change has been the perception shift.
.NET was always really solid tech. Microsoft has always had stellar developer technology. But the love affair with open source and the super villain role that Microsoft played, is what kept people away, not the tech itself.
I remember wanting to give a talk about how amazing C# was to a ruby group. I never did it, but it was definitely a quaint idea in 2011. But rubyists would’ve loved C#.
To be clear, this has nothing to do with .NET Core 3.0 but rather is a feature of C# 8.0, which depends on compiler support that can be targeted to any previous version of .NET Core or Framework, all the way back to Framework 2.0 (tested myself, although MS says not to target 2.0 or 3.5).
Still no exhaustiveness checking like a true match expression unfortunately, which is what would give it parity against the traditional subclass/polymorphic approach.
i actually just did this in f# using the MailboxProcessor. it's beautiful. although, f# has had this since the beginning and is much cleaner being able to define the states and transitions using discriminated unions and having exhaustive pattern matching.
The "core" library was designed for portability and it's not as old as the .NET used for Windows desktop development, which is very mature and very performant.
Well, in the traditional desktop space performance was not that critical as it is with cloud deployments. Also hardware intrinsics are a new toy they have available.
I think it's a combination of monopoly effects plus the benefits of open source: back when .NET was closed-source and only available on Windows, the only way to ship a performance improvement was if an individual developer at Microsoft could convince his boss it was worth it. And it was rarely worth it, because .NET only ran on Windows, its only customers were .NET-only enterprise shops who weren't about to move to an entirely new framework because of perf problems, and there was always a long list of feature requests that PMs would give priority to.
But now that .NET runs everywhere, it has to compete with projects that have been shipping performance improvements all along. Happily, since it's now open-source too, it can accept those changes from anyone.
Non nullable reference types are so awesome! I'd love for the C# team to publish some posts on the creation of this feature. Most of the non nullable type systems exist in functional, or pseudo functional languages (Rust has rather functional semantics). It's very neat to see a honest to god mutable object oriented language implement non nullability. They probably had some interesting implementation challenges.
Also, is Java working on this too? I heard that they have Maybe, but that's pointless without non nullability.
There are some really good write-ups by the C# team on the creation of non-nullable types and how it's implemented but my google-fu is failing me on it.
It's obviously a bit a of hack involving annotations/attributes but for the end user the result is pretty seamless.
When I was in University people loathed .NET and idolized Java. Back then I choose C# instead of Java for my main language/toolset; People thought I was crazy. That was 10 years ago. So happy to see how much C# ecosystem has improved and keeps improving; Only thing missing for me is an official full featured C# to C++ transpiler; Only way, right now, of reaching game console platforms is by converting from C# to C++ unfortunately;
I recently did a live coding tutorial on using SIMD intrinsics which is one of the big new features in .NET Core 3.0. It covers the basics of what is SIMD, what are intrinsics, and I do some live coding/benchmark examples in C# where I cover how to lay out data and use SIMD effectively:
Is anybody using Blazor for anything that isn't a toy? I'm interested in using it at work but because it appears that the payload is relatively large I wouldn't want to use it for anything that wasn't internal facing.
Client-side Blazor is not production-ready with Asp.NET Core 3.0. It's coming in a later release and only server-side Blazor is launched today.
We've been using the server-side components for lots of internal apps. It's very fast and productive to work with, and a great option for internal/enterprise/LOB apps that don't have a lot of users and can handle an occasional reconnection/interruption.
We're exploring using server side blazor for a desktop app. You just bundle the "server" right into the app together with a webview to show your UI. No performance issues because there's only ever one user and you're not relying on a network (or mono or wasm). More exciting, it feels like C# in the browser, but there's no sandbox or threading limitations to speak of. So far it's pretty awesome.
Not knowing much about Blazor, what are you referring to here? The size of the WASM blob for your own code, or does Blazor have an associated runtime that's large? And what is considered "large"?
Scott Hunter today presented a Blazor based Electron App in the .NET 5 timespan.
I am not the biggest fan of HTML, but considering the maturity of that ecosystem, design tools and knowledge among designers, that could be a very valid move.
> Nullable enables you to directly target the flaws in code that lead to NullReferenceException. The lowest layer of the framework libraries has been annotated, so that you know when to expect null.
I hope Java gets this one day.. would be a cool feature
You can try checkerframework [1], which uses annotations to perform extra typechecking at compile time, including nullable/not-nullable checks.
Works properly altough it has a few issues: the biggest is that support is still stuck at java 8, and the framework is sometimes not smart enough to see that you already checked if a nullable field is null or not and you can safely use it.
Not migrated, but we do a lot of CRUD based applications for clients and have a small dev team so it feels like we're kinda porting it over.
The largest change is dependency injection and Entity Framework. DI is insanely better and just more intuitive. EF is really a move from EF to EF Core which has quite a few differences that can introduce some road bumps.
In my opinion, I've gained the most from moving from HTML helpers in Razor to Tag Helpers. It's basically just components for Razor, but it allows us to make a really nice UI library and cuts down on so much of our markup without having to write a bunch of overloads for the same helper.
As far as MVC vs. Razor Pages, I'm still not in love with Pages. It feels a bit too much like ASP.NET Web Forms did. I still use MVC practices and it's almost the same exact experience. AJAX forms are a bit better this time around, but I'm really waiting until Blazor becomes more viable before I make a jump like that.
Doing a quick skim, it feels like that migration guide should still cover the basics. (I don't think there is a big developer-facing change between ASP.NET Core 2.1 and 3.0; small subtle things like the Generic Host Builder. But you should be fine using the guide here to migrate to 2.1 and you can find simple posts on the 2.1 to 3.0 changes.)
I'm not convinced ASPNETCore 3.0 is ready to be used in anger yet. Perhaps this thread from a couple weeks ago is not representative, but I've seen other similar feedback
Yes - while WPF and Windows Forms are still Windows-exclusive, there are several cross-platform UI libraries for .NET Core, like Eto.Forms (https://github.com/picoe/Eto) and Avalonia (https://avaloniaui.net/).
How you approach this is very dependent on where you're coming from (i.e. existing solution) but with WPF and Winforms now part of Core 3.0 you can then build a native, single exe by specifying the target architecture (ex: win x64) and then bundling the framework with your app. They do some trimming as well (i.e. tree shaking) to get the exe size down but have admitted it's still in early stages and sometimes drops required framework components. You can fix this by adding an explicit reference to the assembly in your project source though...
There are a million ways to get onto different platforms though, ranging from the above, to xamarin to electron (via blazor), to net-new apps, etc.
C# (the default .Net lang) has so much ceremony, boilerplate/scaffolding and IDE dependence (IDE programmers) and OOP overhead that it requires 5x more lines of code than the same app in Python or Go. Every time my interest peaks, I take a look leave with the same feeling that it's a dated/bloated OOP relic and would take all the joy out of programming. I've also noticed that most C# programmers don't usually know another language (other than a little JS) and seem totally dependent on Visual Studio; if all they had was a text editor they'd be lost. That's not a good place to be.
C# has very minimal boilerplate for a lot of uses. I can throw together a simple CRUD UI app in WinForms in well under a day. Visual Studio handles writing all the data binding code for me, code that I'd have to write myself in any other language.
Using one of the enterprise frameworks, sure, those all have boilerplate, in any language, especially the older frameworks.
And for some tasks, the amount of boilerplate is tiny. I can write out a struct/class with property names matching my JSON, and watch as C# automatically data binds the JSON to a UI. The amount of boilerplate I need to do that in the browser is pretty much identical, or I can learn / figure out some fancy auto-binding toolkit that has its own boiler plate and learning curve.
You can be seriously functional in C#. Passing around lambdas and using functional techniques to manipulate data has been idiomatic C# for over a decade.
> I've also noticed that most C# programmers don't usually know another language
Stereotyping is not good. I <3 C#, but I've written embedded C, C++, JavaScript, Typescript, and Python.
If you go to most corporate dev places, you will find a significant population of single language devs. Same things happen with any popular corporate language. While I agree that learning multiple programming languages makes for better developers, blaming a language for being popular is hardly fair.
Heck the number of developers who have historically only worked in C/C++ was really high for multiple decades.
I think you might want to take a slightly different look at it as I have found the opposite.
You also might need to find better C# programmers as I honestly don't know any C# programmers who only know one language or one editor. An awesome IDE is big perk to development. I don't think that should be considered a con.
.NET also has tons of "magic features" like Data Annotations & Attribute Tags for those who want some magic that reduces code & helps get stuff done faster.
JS & other languages reference it when looking to introduce new features.
C# is anything but dated. One could call it bloated as it is one of the most flexible languages with about 10 ways to do anything. That is a strength & a weakness of any language that positions itself as a Swiss army knife type tool that wants to be able to be used everywhere. With C# you can write a lot of nice fairly functional programming style code & OOP code which is a nice perk.
If you're interested in .net and the clr, you could replace c# with f#.
It's the most practical functional language that I've tried. Great for domain modeling and it can used in C# projects.
I also think that c# is too verbose so what I normally do: asp.net core mvc for routing, templating, authentication / authorization, data access etc and then reference an f# project that contains the domain logic. The best of both worlds.
If you're writing boilerplate code in C#, it's either because you prefer to be explicit, or because you don't know how to use reflection and dynamic compilation yet. Using C# without reflection is like using Scheme without macros. That said, just like macros lead to DSLs, reflection leads to custom frameworks which then have to be explained to newcomers. It's definitely a cost/benefit thing, and there's an argument against ever using reflection. I can't live without it at this point though. You could say I've 'gone through the looking glass'.
If you're a C# dev who hasn't dug in to reflection yet, the gist is that all the things that the MVC, ORM, DI frameworks do, you can also do. This allows you to build custom frameworks which eliminate boilerplate.
I'm not sure about the comparison to Go as that can get very verbose. Same with Python. And JS is an absolute mess compared to C#/.NET which has a fantastic standard library and many conventions to get going fast.
.Net (and Java) run the Fortune 1000 so there will of course be lots of devs specialized in that. There's nothing wrong with being very good with 1 language and stack when you're paid to be productive for the company. Also you can definitely write C# with a simple text editor if you have to, and VSCode is pretty slim already, but why would you want to when there's such a powerful IDE available?
This sounds like a purity argument about how to be a "real programmer", but I would much rather work with people who are good at what they do and get things done instead.
That was a lot of predispositions. I can say for sure I've never scaffolded anything in C#, I can write a fully functional web app using Notepad++, the different parts of the startup are not hard to memorize, and I can't imagine scaffolding being useful in a console application.
Yeah, it requires more lines to achieve the same thing in other languages, that isn't a pro or con.
And myself personally, I started with Basic, and have used C++, C, Python, Java, JS and C# throughout my career, but I'm also sure you can find many more Python/Go developers who only know Python/Go
It'a unfortunate you don't like the language and I hope Microsoft and the open-source developers continue to add more features so that one day you'll find the joy may developers have found in using C#
I don't get why people don't like IDEs. If you're digging a ditch you're dependent on your shovel (or even better, an excavator). You can do it with your hands, but why would you want to? Just as the shovel magnifies your digging capacity, the IDE magnifies your capacities as a coder.
avgDev|6 years ago
Also, Visual Studio is an insane IDE. Although, I recently did have some nasty bugs but updates are coming out pretty quickly.
Edit: Microsoft has also added many new videos to help beginners, these cover various topics https://dotnet.microsoft.com/learn/videos.
gtsteve|6 years ago
jsingleton|6 years ago
Being an early adopter sucks unless you're just testing it out. If it's your job then wait for it to stabilise and for the real-world bug fixes.
The next Long Term Support version of .NET Core will be 3.1. It should be out in November.
gargarplex|6 years ago
tabtab|6 years ago
If you had to rank and list the top rough spots in the transition, what would they be? Entity-Framework changes are often cited, but what else is different enough?
dmix|6 years ago
privateSFacct|6 years ago
That and I never got to develop successfully beyond Forms - which I wish was not in preview from designer standpoint. I know old tech, but frankly for older programmers I find it easier and quicker to get stuff up with.
atonse|6 years ago
.NET was always really solid tech. Microsoft has always had stellar developer technology. But the love affair with open source and the super villain role that Microsoft played, is what kept people away, not the tech itself.
I remember wanting to give a talk about how amazing C# was to a ruby group. I never did it, but it was definitely a quaint idea in 2011. But rubyists would’ve loved C#.
jsingleton|6 years ago
- https://devblogs.microsoft.com/dotnet/announcing-net-core-3-...
- https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazo...
- https://devblogs.microsoft.com/dotnet/announcing-f-4-7/
- https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0...
- https://dotnet.microsoft.com/download/dotnet-core (if you're on 2.2 you have until the end of the year to update to 3.1, which will be LTS)
- https://www.dotnetconf.net/ live now
Shame about the bad timing with the UN summit: http://webtv.un.org/
ifthenelseend|6 years ago
ComputerGuru|6 years ago
platz|6 years ago
nikofeyn|6 years ago
hmexx|6 years ago
https://devblogs.microsoft.com/dotnet/performance-improvemen...
How could a mature standard library / frameworks have so much performance gains to be had?
benaadams|6 years ago
And in 2.1 https://devblogs.microsoft.com/dotnet/performance-improvemen...
3.0 has new JIT capabilities like CPU hardware intrinsics; devirtualization; Span etc which in turn enable new techniques in the standard library.
Though 3.0 is a vast set of improvements compared to the previous two
fortran77|6 years ago
giulianob|6 years ago
oaiey|6 years ago
9wzYQbTYsAIc|6 years ago
The_rationalist|6 years ago
Analemma_|6 years ago
But now that .NET runs everywhere, it has to compete with projects that have been shipping performance improvements all along. Happily, since it's now open-source too, it can accept those changes from anyone.
_hardwaregeek|6 years ago
Also, is Java working on this too? I heard that they have Maybe, but that's pointless without non nullability.
wvenable|6 years ago
There are some really good write-ups by the C# team on the creation of non-nullable types and how it's implemented but my google-fu is failing me on it.
It's obviously a bit a of hack involving annotations/attributes but for the end user the result is pretty seamless.
jdmichal|6 years ago
In other words: I used to have `null` problems. Then I used `Optional`, and now I have two `null` problems!
MrBuddyCasino|6 years ago
disease|6 years ago
rafaelvasco|6 years ago
darzu|6 years ago
tofflos|6 years ago
gameswithgo|6 years ago
https://www.twitch.tv/videos/482930779?t=00h09m01s
Nelkins|6 years ago
manigandham|6 years ago
We've been using the server-side components for lots of internal apps. It's very fast and productive to work with, and a great option for internal/enterprise/LOB apps that don't have a lot of users and can handle an occasional reconnection/interruption.
m_fayer|6 years ago
landr0id|6 years ago
Not knowing much about Blazor, what are you referring to here? The size of the WASM blob for your own code, or does Blazor have an associated runtime that's large? And what is considered "large"?
sunnyP|6 years ago
daliz|6 years ago
grokys|6 years ago
oaiey|6 years ago
I am not the biggest fan of HTML, but considering the maturity of that ecosystem, design tools and knowledge among designers, that could be a very valid move.
pcunite|6 years ago
That's a big deal! Nice.
truth_seeker|6 years ago
Azure has started investing heavily in offloading the task from CPU to GPU and FPGA. There are really good framework on .NET to achieve the same.
NVIDIA CUDA GPU - https://devblogs.nvidia.com/hybridizer-csharp/
GPU scripting and CUDA - http://www.aleagpu.com/release/3_0_4/doc/
FPGA - https://hastlayer.com/project, https://netfpga.org/site/#/
krat0sprakhar|6 years ago
I hope Java gets this one day.. would be a cool feature
royjacobs|6 years ago
mrighele|6 years ago
[1] https://checkerframework.org/
jrimbault|6 years ago
xvilka|6 years ago
GordonS|6 years ago
unknown|6 years ago
[deleted]
DenisM|6 years ago
Anyone recently migrated projects from ASP.NET MVC to ASP.NET Core? I hope there is a gradual way, like this: https://www.hackernoon.com/how-to-migrate-project-from-aspne...
pathartl|6 years ago
The largest change is dependency injection and Entity Framework. DI is insanely better and just more intuitive. EF is really a move from EF to EF Core which has quite a few differences that can introduce some road bumps.
In my opinion, I've gained the most from moving from HTML helpers in Razor to Tag Helpers. It's basically just components for Razor, but it allows us to make a really nice UI library and cuts down on so much of our markup without having to write a bunch of overloads for the same helper.
As far as MVC vs. Razor Pages, I'm still not in love with Pages. It feels a bit too much like ASP.NET Web Forms did. I still use MVC practices and it's almost the same exact experience. AJAX forms are a bit better this time around, but I'm really waiting until Blazor becomes more viable before I make a jump like that.
WorldMaker|6 years ago
topbanana|6 years ago
That isn't true. You can target .Net framework 4.0 onwards.
thrower123|6 years ago
https://twitter.com/RickStrahl/status/1171285693244436481
juliocasal|6 years ago
factorialboy|6 years ago
strangecasts|6 years ago
It's also possible to build an Electron wrapper around an ASP.NET Core web app: https://github.com/ElectronNET/Electron.NET
ticmasta|6 years ago
How you approach this is very dependent on where you're coming from (i.e. existing solution) but with WPF and Winforms now part of Core 3.0 you can then build a native, single exe by specifying the target architecture (ex: win x64) and then bundling the framework with your app. They do some trimming as well (i.e. tree shaking) to get the exe size down but have admitted it's still in early stages and sometimes drops required framework components. You can fix this by adding an explicit reference to the assembly in your project source though...
There are a million ways to get onto different platforms though, ranging from the above, to xamarin to electron (via blazor), to net-new apps, etc.
ragechip|6 years ago
mcdermott|6 years ago
com2kid|6 years ago
Using one of the enterprise frameworks, sure, those all have boilerplate, in any language, especially the older frameworks.
And for some tasks, the amount of boilerplate is tiny. I can write out a struct/class with property names matching my JSON, and watch as C# automatically data binds the JSON to a UI. The amount of boilerplate I need to do that in the browser is pretty much identical, or I can learn / figure out some fancy auto-binding toolkit that has its own boiler plate and learning curve.
You can be seriously functional in C#. Passing around lambdas and using functional techniques to manipulate data has been idiomatic C# for over a decade.
> I've also noticed that most C# programmers don't usually know another language
Stereotyping is not good. I <3 C#, but I've written embedded C, C++, JavaScript, Typescript, and Python.
If you go to most corporate dev places, you will find a significant population of single language devs. Same things happen with any popular corporate language. While I agree that learning multiple programming languages makes for better developers, blaming a language for being popular is hardly fair.
Heck the number of developers who have historically only worked in C/C++ was really high for multiple decades.
mattferderer|6 years ago
You also might need to find better C# programmers as I honestly don't know any C# programmers who only know one language or one editor. An awesome IDE is big perk to development. I don't think that should be considered a con.
.NET also has tons of "magic features" like Data Annotations & Attribute Tags for those who want some magic that reduces code & helps get stuff done faster.
JS & other languages reference it when looking to introduce new features.
C# is anything but dated. One could call it bloated as it is one of the most flexible languages with about 10 ways to do anything. That is a strength & a weakness of any language that positions itself as a Swiss army knife type tool that wants to be able to be used everywhere. With C# you can write a lot of nice fairly functional programming style code & OOP code which is a nice perk.
Parazitull|6 years ago
It's the most practical functional language that I've tried. Great for domain modeling and it can used in C# projects.
I also think that c# is too verbose so what I normally do: asp.net core mvc for routing, templating, authentication / authorization, data access etc and then reference an f# project that contains the domain logic. The best of both worlds.
caseymarquis|6 years ago
If you're a C# dev who hasn't dug in to reflection yet, the gist is that all the things that the MVC, ORM, DI frameworks do, you can also do. This allows you to build custom frameworks which eliminate boilerplate.
manigandham|6 years ago
.Net (and Java) run the Fortune 1000 so there will of course be lots of devs specialized in that. There's nothing wrong with being very good with 1 language and stack when you're paid to be productive for the company. Also you can definitely write C# with a simple text editor if you have to, and VSCode is pretty slim already, but why would you want to when there's such a powerful IDE available?
This sounds like a purity argument about how to be a "real programmer", but I would much rather work with people who are good at what they do and get things done instead.
michannne|6 years ago
Yeah, it requires more lines to achieve the same thing in other languages, that isn't a pro or con.
And myself personally, I started with Basic, and have used C++, C, Python, Java, JS and C# throughout my career, but I'm also sure you can find many more Python/Go developers who only know Python/Go
It'a unfortunate you don't like the language and I hope Microsoft and the open-source developers continue to add more features so that one day you'll find the joy may developers have found in using C#
unknown|6 years ago
[deleted]
bobcostas55|6 years ago
Spooks|6 years ago
But I definitely lean on the intellisense of the IDE fairly regularly, I don't think I would completely lost, but it would take me longer.
Dude2029|6 years ago