Live data from Hacker News

.NET 5.0

devblogs.microsoft.com

81–90 of 466 posts

Re: .NET 5.0

#81
post #3
post #2

With Linux support AOT compliation and other goodies I wonder how many people will prefer writing backends in .NET over Java.

No thanks. I've been writing .Net since before day one and quite frankly I've been buggered around enough now to run as far away from this as possible.

Wherever you run to, you will get buggered around a bunch and then run somewhere else.

Re: .NET 5.0

#82

Earlier quoted context omitted.

So you want to pause the thread and keep it from processing other requests for simplicity?

That is literally how php does. Let's fire a thread for every request and block on db reading or any action that require io. And it seems it works (at least for php)

.NET is meant for stuff like microservices; you don't see lots of those written in php, right?

Also, for high-traffic websites, that's really not a great idea. You might say "but Facebook, PHP" - I'm really certain that their current codebase doesn't have a thread that blocks on DB for each user request.

Re: .NET 5.0

#83

Does anybody knows if .NET 5.0 will be included in Windows as a Windows Update as the .NET Framework ?

It won't be. .NET Framework is an embedded component of Windows. .NET Core is something apps have to package along with them. (Due to this, .NET Core apps are larger than .NET Framework apps, but tend to have less compatibility issues in theory, since they bring everything they need with them.)

Are you sure it will not be distributed with Windows? Is 4.8 the last version being distributed with Windows, requiring all future .NET framework versions to be packaged with the apps?

Re: .NET 5.0

#84

Earlier quoted context omitted.

>and you're in for an even bigger nightmare if you want to separate business logic and web code into two projects (which is a pretty common design). I've given up with the config DI and just assign them all to static variables. So you have static variable in web project and then add reference to web project to obtain that config? Do I get that right? I never felt like config DI was a problem once you did all the stuf…

To me it's just so pointless, here's an example: using Microsoft.Extensions.Configuration; //extra line using Microsoft.Extensions.Options; //extra line public class AdminController : Controller { IOptions settings; //extra line public AdminController(IOptions settings) //extra code { this.settings = settings; //extra line } public void RandomMethod() { var a = settings.Value.FinallyMySetting; // 5 extra lines to acc…

Apart from needing two namespaces, this does look reasonable to me. I'm not sure how you could make constructor-based dependency injection easier without making it less obvious what is happening. And most of the additional lines are stuff your editor can do for you, even in VS Code you can automatically generate the field and assignment and the imports after just typing the constructor parameter.

ASP.NET Core does push you strongly towards dependency injection, but it does not force you at all to use it.

Re: .NET 5.0

#85

> .NET 6.0 will use the same approach, with net6.0, and will add net6.0-ios and net6.0-android Huge endeavor and launch! Looks like mobile app development will be the same with Xamarin

Mobile development in C# is just dead. Flutter got all the momentum.

It's ok but not huge. I'm starting a second mobile app in native Xamarin and there are some pretty active communities around.

Re: .NET 5.0

#86
post #59

Earlier quoted context omitted.

You can do that just with different config files or env vars too. No need to complicate code for stuff that can be done easily differently as well.

And then you realize that it's 2020 and you don't want configuration files, you want environment variables. Or, now that you've hardstuck yourself on environment variables and built all this stuff around them to set and re-set them properly between tests (now running either in multi-process, which good luck in most environments, or are just running in serial ), you're using k8s and the voluming of secrets rather than…

[deleted]

Re: .NET 5.0

#87

Earlier quoted context omitted.

I do agree I just type IOptions config in ctor, use ctrl+. and private readonly property and it's initialization is generated

That doesn't work unless you already have the using statements, which you won't have as you haven't added it yet. I just tried it.

[deleted]

Re: .NET 5.0

#88

Earlier quoted context omitted.

Authentication is in the request pipeline, so it makes sense that it's async if you're talking to some sort of storage engine. We're using the async APIs to pull user/client app information from our database. Why would we want that to be synchronous?

For simplicity? Just like how js get async await thing eventually.

I fail to see how this is sensible in the slightest - you then have to re-write the code if you want the application to scale. Otherwise you are wasting memory, trashing GC, spawning all these extra threads.All awaitable operations like network requests, disk reads, etc, should be async. Why would you write potato code?

Re: .NET 5.0

#89
post #80
post #32

is this an in-place update to the netcore3.1 runtime or does it install side by side for net5.0? just want to know what kind of risk it is to install. i got bit by the netfx48 in place update.

How did net48 bite?

extensive changes to the gc exposed an application issue that was complex to address. and no way to rollback the machine to net472.

Re: .NET 5.0

#90

Earlier quoted context omitted.

I do agree I just type IOptions config in ctor, use ctrl+. and private readonly property and it's initialization is generated

That doesn't work unless you already have the using statements, which you won't have as you haven't added it yet. I just tried it.

I'm using Roslynator:

https://i.imgur.com/cWs1M77.png

and I have some naming rule

https://i.imgur.com/iPwNj5b.png

So I basically have to type IOptions Name and use ctrl+. twice in order to generate private readonly property and initialize it and add using to IOptions

Post reply on HN