
.NET Core 3.0 - hmexx
https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0/
======
avgDev
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.

Edit: Microsoft has also added many new videos to help beginners, these cover
various topics
[https://dotnet.microsoft.com/learn/videos](https://dotnet.microsoft.com/learn/videos).

~~~
tabtab
Re: _I would say the learning curve is pretty high_

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?

~~~
mieseratte
Having just come into a .NET shop in the last couple months, having spent much
time with Spring / Java the documentation and clarity of what to use is
troublesome. I really expected Microsoft to have great documentation, but
sadly I’ve not found it great.

So far I’ve done some WCF SOAP work, and an ASP.NET MVC 5 application.
Figuring out what the latest frameworks and tools is a bit of legwork. Things
aren’t always clear, and not always well integrated.

Figuring out authentication was not clear, whether to use Membership,
Identity, where OWIN fit into the picture. If you need custom authentication
finding details is hard. Ultimately I figured it out, but it’s clear as mud
from a fresh eyes standpoint.

Then setting up DI, which container? Well I had Core DI available, figured
that would be a good choice. Except I have to write a good bit of glue code to
make it work.

I’m definitely enjoying C# as a language and the standard library. But the
ecosystem is a bit clunky.

~~~
keithnz
its very simple to get .net core DI working, shouldn't be much code other than
registering your types / service.

await new HostBuilder().ConfigureServices((context, services) => { //
services.AddTransient.... }).UseConsoleLifetime().Build.RunAsync()

~~~
mieseratte
I’m talking DI for ASP.NET MVC 5, non-Core.

That required a custom provider (trivial), and non-obviously a custom
ControllerFactory as I picked Core DI instead of a more fully-fledged
solution.

Unfortunately there is very little obviousness in documentation and germs
often get conflated and confused. Perhaps this is MS trying to get me to take
one of their infamous certification courses?

~~~
avgDev
That is because MVC 5 did not support DI out of the box. This has been fixed
with Core. It is quite easy now, since I was able to figure it out haha.

------
privateSFacct
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.

~~~
atonse
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#.

~~~
dragonwriter
> But rubyists would’ve loved C#.

As a Rubyist, I'll admit that C# is the least bad of the C++/Java style of
static OOP languages, but it was that it was always too tied to the .NET
ecosystem and heavyweight enterprise tooling more than Microsoft's
“supervillian role” with regard to FOSS that made it unattractive for lots of
places where I would want to use Ruby. That's improved with Core, somewhat.

~~~
atonse
I was a fulltime ruby developer before I became a full-time .NET developer
(usually by accident). And things like Linq, Visual Studio, and Resharper
ultimately allowed me to create code that was highly organized, while never
sacrificing productivity or performance.

The thing I always hated most about the .NET ecosystem was having to run on
Windows Server, so that's definitely a welcome change with .NET Core.

But C# has always been a wonderful language to work with. And you never really
feel the static typing slow you down, yet get all the benefits of not having
to write a bunch of useless tests that replace what a compiler should do in
the first place.

(Not trying to make this a dynamic/static flame war by the way. I'm a full-
time elixir developer nowadays, so I'm still in dynamic-land and enjoy it.
Just not dogmatic about any of it)

~~~
fgonzag
More than windows it was the GUI centered developer tools and server setup.
With powershell and the dotnet CLI things have improved massively. Now that we
can just run on Linux I'm absolutely in love. I still use Java for some
projects because of library dependencies (and kotlin also makes the work
enojayble) but I prefer .net for Greenfield projects

------
jsingleton
There are a few related announcements, here are some links:

\- [https://devblogs.microsoft.com/dotnet/announcing-net-
core-3-...](https://devblogs.microsoft.com/dotnet/announcing-net-core-3-0/)

\- [https://devblogs.microsoft.com/aspnet/asp-net-core-and-
blazo...](https://devblogs.microsoft.com/aspnet/asp-net-core-and-blazor-
updates-in-net-core-3-0/)

\-
[https://devblogs.microsoft.com/dotnet/announcing-f-4-7/](https://devblogs.microsoft.com/dotnet/announcing-f-4-7/)

\- [https://devblogs.microsoft.com/dotnet/announcing-ef-
core-3-0...](https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0-and-
ef-6-3-general-availability/)

\- [https://dotnet.microsoft.com/download/dotnet-
core](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/](https://www.dotnetconf.net/) live now

Shame about the bad timing with the UN summit:
[http://webtv.un.org/](http://webtv.un.org/)

------
ifthenelseend
Now you can easily write the following state machine in C#:

    
    
        static State ChangeState(State current, Transition transition, bool hasKey) =>
    
        (current, transition) switch
    
        {
    
            (Opened, Close)              => Closed,
    
            (Closed, Open)               => Opened,
    
            (Closed, Lock)   when hasKey => Locked,
    
            (Locked, Unlock) when hasKey => Closed,
    
            _ => throw new InvalidOperationException($"Invalid transition")
    
        };

~~~
ComputerGuru
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).

~~~
legulere
C# 8 needs .net core 3.0 for some features to work at all like default
interface method implementations, and for some to work meaningfully like
nullable reference types.

------
hmexx
List of performance improvements is mind-boggling:

[https://devblogs.microsoft.com/dotnet/performance-
improvemen...](https://devblogs.microsoft.com/dotnet/performance-improvements-
in-net-core-3-0/)

How could a mature standard library / frameworks have so much performance
gains to be had?

~~~
fortran77
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.

~~~
benaadams
.NET Core is faster than .NET Framework

------
_hardwaregeek
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.

~~~
wvenable
PHP has non-nullable reference types!

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.

------
rafaelvasco
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;

~~~
darzu
Or use Unity?

~~~
rafaelvasco
Yeah. That or using Monogame's Brute compiler. But a standard way would be
good to have;

------
tofflos
It's nice to see Alpine on the list of supported operating systems. The image
mcr.microsoft.com/dotnet/core/runtime:3.0.0-alpine3.9 is 86.7MB.

------
gameswithgo
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:

[https://www.twitch.tv/videos/482930779?t=00h09m01s](https://www.twitch.tv/videos/482930779?t=00h09m01s)

------
Nelkins
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.

~~~
landr0id
>it appears that the payload is relatively large

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"?

~~~
Nelkins
I guess I was hoping the WASM/IL trimming would be more aggressive. My
comparison isn't very scientific, I'm mostly comparing things like
[https://fsbolero.io/TodoMVC/](https://fsbolero.io/TodoMVC/) which is done
with Blazor vs [https://yew-todomvc.netlify.com/](https://yew-
todomvc.netlify.com/) which is done with Yew. The former is nearly 6MB in
total, the latter is 135KB.

~~~
manigandham
Blazor client-side works by using the Mono runtime which is compiled and run
as WASM. Your application is still delivered as standard DLLs and interpreted
by that runtime.

They're working on making the runtime smaller and faster to start still a lag
since your code has to be parsed and interpreted everytime, although the DLLs
are pretty small already and easily compressed.

------
daliz
It would have been great if it allowed to make .NET Desktop apps for macOS and
Linux, in addition to Windows.

~~~
grokys
We're trying to do that over at
[https://github.com/AvaloniaUI/Avalonia](https://github.com/AvaloniaUI/Avalonia)
if you're interested. Doesn't have MS (or any other company's) backing, and is
still in beta, but quite usable for creating x-plat apps. You can see some
projects built on it here
[https://github.com/AvaloniaUI/Avalonia/wiki/Projects-that-
ar...](https://github.com/AvaloniaUI/Avalonia/wiki/Projects-that-are-using-
Avalonia)

~~~
ygra
I was surprised when the PowerShell team announced that Out-GridView made a
reappearance in PowerShell Core, built with Avalonia. So at least someone at
Microsoft took notice.

I'm really rooting for the project to gain some support. Right now I'd love to
try porting our custom UI component at work to Avalonia, just to try it out.
But that's time not well invested in something with little backing and
potentially few customers for us.

~~~
Sammi
Announcement here: [https://devblogs.microsoft.com/powershell/out-gridview-
retur...](https://devblogs.microsoft.com/powershell/out-gridview-returns/)

------
pcunite
_.NET Core 3.0 will be available with RHEL 8 in the Red Hat Application
Streams, after several years of collaboration with Red Hat._

That's a big deal! Nice.

------
truth_seeker
If you dont know already:

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/](https://devblogs.nvidia.com/hybridizer-csharp/)

GPU scripting and CUDA -
[http://www.aleagpu.com/release/3_0_4/doc/](http://www.aleagpu.com/release/3_0_4/doc/)

FPGA - [https://hastlayer.com/project](https://hastlayer.com/project),
[https://netfpga.org/site/#/](https://netfpga.org/site/#/)

------
krat0sprakhar
> 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

~~~
mrighele
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.

[1] [https://checkerframework.org/](https://checkerframework.org/)

~~~
ygra
Annotations don't work for local variables, though. So you only get
nullability checking around calling methods and accessing fields, right?

~~~
mrighele
Annotations in general do work for local variables, although this is specified
on a per-annotation basis.

If I remember correctly, for example, the @NotNull annotation in
javax.validation.constraints cannot be used for a local variable, but the one
provided by the checkerframework can.

------
xvilka
Too bad FreeBSD support didn't make it into this version.

~~~
GordonS
Or indeed Linux x86 support :(

------
DenisM
The only way to get C# 8 is to move to .NET Core, I can't really avoid this
anymore. And for me it means moving to ASP.NET Core...

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...](https://www.hackernoon.com/how-to-migrate-project-from-
aspnet-mvc-to-aspnet-core-qt1ks31zn)

~~~
pathartl
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.

------
juliocasal
For anybody interested, here for a short video on how to containerize an
ASP.NET Core 3.0 Web API:
[https://youtu.be/Po9jQS7WBDQ](https://youtu.be/Po9jQS7WBDQ)

------
factorialboy
Sorry for a basic question, can this be used to make desktop apps across
platforms?

~~~
strangecasts
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](https://github.com/picoe/Eto)) and Avalonia
([https://avaloniaui.net/](https://avaloniaui.net/)).

It's also possible to build an Electron wrapper around an ASP.NET Core web
app:
[https://github.com/ElectronNET/Electron.NET](https://github.com/ElectronNET/Electron.NET)

~~~
rajeev-k
Docker is a better way to distribute apps than Electron, in my opinion. From a
developer point of view you just build a regular web app, so better than
Electron. From the user's point of view, Docker is better because of
isolation, and because there is nothing to install. You run just one command
to download and run the image. If you want the app to have its own window then
use Chrome's "Create shortcut" command. This is indistinguishable from an
Electron app, but better. See an app written in this fashion here:
[https://hub.docker.com/r/eurekasearch/eurekasearch](https://hub.docker.com/r/eurekasearch/eurekasearch)

~~~
strangecasts
For the end user there _is_ something to install - specifically, Docker, which
is quite... hefty on Windows

~~~
charrondev
If I remember correctly it also requires windows pro or enterprise.

These 2 requirements make this fundamentally unusable for most.

\- Windows 10 64-bit: Pro, Enterprise, or Education (Build 15063 or later). \-
Hyper-V and Containers Windows features must be enabled.

~~~
noisem4ker
Docker Toolbox, although less polished, is based on VirtualBox and happily
runs without Hyper-V. The only thing I've found missing is the control panel
GUI.

[https://github.com/docker/toolbox](https://github.com/docker/toolbox)

------
ragechip
This is a good leap release from msft.

------
mcdermott
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.

~~~
com2kid
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.

~~~
julienfr112
Under a day ?? Make an app with pyqt5 or kivy and it's under an hour...

~~~
com2kid
> Under a day ?? Make an app with pyqt5 or kivy and it's under an hour...

Last CRUD app I did in WinForms:

1\. Auth

2\. Real time push updates from my database

3\. Platform native looking UI

4\. Automatic 2 way data binding between my backing JSON and my UI controls.

I hadn't used C# for ~2 years, I had never used that particular DB library or
done any work with JSON in C#.

I got it done in under 4 hours.

If I did it now, yeah, even faster.

The amount of code I wrote is insanely tiny. I wanted some custom date/time
formatting stuff so I had to implement that myself.

I just checked the source out, I wrote under 120 LOC total, and that is
including the repetitive ~70 LOC I did for handling days of the week and auto-
formatting user entered times. (Time sucks, working with time sucks.)

Without that my code would've been limited to:

1\. Wiring login button up to sending username/password to the DB 2\.
Attaching a listener to the DB (C# has had native event handling as a
primitive type since forever!) 3\. The save button to push stuff to the DB.

Did I have to drag and drop some UI elements onto a page? I sure did. It was
rather nice.

WinForms was _the_ go to solution for CRUD apps for a reason. Sure VB6 was
probably better at popping CRUD apps out in no time, but after that died out,
WinForms was a really good replacement.

