Live data from Hacker News

.NET 5.0

devblogs.microsoft.com

421–430 of 466 posts

Re: .NET 5.0

#421

Earlier quoted context omitted.

"Our migration from 4.7=>2.0 was the most difficult" Would love to see a write up of your challenges / approach. Seems to be a big lack of write ups on this process that I'm sure lots of devs would appreciate!

My team did this when we moved Bing.com over to .NET Core, but it's internal. I will see if we can make it public. The problem is there are some skeletons in the closest that are irrelevant now (some since NS2.0, more since netcoreapp3.1), so I wonder how informative it will be.

Would love to read about that, even if some parts are now already outdated or no longer as big am obstacle.

A site as large / complex as I assume bing is would possibly allay lots of our concerns and give us some concrete steps to move forward with.

Re: .NET 5.0

#422
post #340

Earlier quoted context omitted.

Thank you very much for sharing your DI experience. What is wrong with using IServiceProvider dependency? What is CTOR (hierarchy)?

CTOR hierarchy in this case refers to a rigid structure in which you are not allowed to have any circular dependencies. E.g.: If UserService and AccountService eventually evolve into needing to talk to each other, you can wind up in this situation. Most would argue you should refactor both services, create a 3rd service or slam the 2 together into 1. I argue that both have independent persistence layers and it makes…

Got it. I appreciate your detailed and clear reply.

Re: .NET 5.0

#423
post #208

So, on the plus side with the new .net, I recently made a .net core web app on Linux, and generally it's been pretty easy. I'm also impressed at just how fast asp.net core is compared to asp.net, the time it takes to open your site in debug mode has dropped dramatically, from what used to be 1/2 minute in asp.net to a few seconds in .net core. On the bad side? Mainly the asp.net core team and their push for Dependenc…

I'm so glad I'm not alone. I adore C# and the .NET runtime is so convenient. But the ASP.NET part feels bloated. Is there a simpler .NET framework?

Feather HTTP https://github.com/featherhttp/framework. From the description: A lightweight low ceremony API for web services.

Re: .NET 5.0

#424
post #402
post #304

Would most people here agree that .NET is a much better platform for developing applications with a plugin-based architecture (which, I think, more or less, implies following Hexagonal aka Clean Architecture / Ports and Adapters Pattern [1]) than popular alternatives (e.g., Python, TypeScript/Node.js) due to a diverse set of comprehensive dependency injection (DI) implementations [2]? While it is possible to use a ma…

I think Python, TS/JS and other popular languages do not block onion architectures / hexagonal architecture. Or most other patterns. It is a matter of will and the right execution. Also, DI is not the same DI containers. If I have three components and inject two into another one, I do DI but for sure will not instantiating a DI container for it ;)

I didn't mean that non-.NET stacks are somehow antagonistic to hexagonal architecture. It's just that, based on what I have been reading on the subject, I came to a conclusion that .NET has the most comprehensive support of said architecture thanks to a diverse and feature-rich ecosystem of relevant frameworks (including DI ones), whereas alternative stacks are significantly behind in this regard.

Re: .NET 5.0

#425

Earlier quoted context omitted.

> My biggest bugbear is the way you access your config, which is an absolute and utter kafka-esque mess. Because someone at MS was drinking the DI kool-aid you have to add a minimum of 5 lines of code to any class you want to access config values in I'm not sure if maybe you're referring to the Options stuff? The way I do it is pretty simple. 1. Create a POCO that represents your config. You can have properties for b…

I think the OP is referring to accessing the config 5 layers down from the controller. I've run into it myself. To be able to do that, you have to add Options to the constructor of every class in the chain and then configure DI for it. It just has bad code smell. On my last project, I just assigned the configs to a static class that's available everywhere and the code was just simply much cleaner.

“5 layers down”

This is precisely why I jumped ship 5 years ago to Go.

Re: .NET 5.0

#426
post #407

Earlier quoted context omitted.

When your code depend on stuff not migrated yet, it will no longer happen. From a .NET Framework position, .NET 5 is a huge breaking change by loosing capabilities and using different base libraries (which will not be recovered later). From a .NET Core 3.1 perspective, it is a minor update. .NET 5 reality is: They ported 90% of their app models (e.g. wpf, winforms, ...) and dropped some other (e.g. WCF, WWF, AppDomai…

Well, I've still got to support integrations with other Microsoft products that are in support for the next decade, and only have Fx SDKs. Tooling in Visual Studio has sucked out loud for most of the Core stuff thus far. There's not a lot of value chasing the churn versus letting it settle out.

I am also there. Ugly.

Re: .NET 5.0

#427
post #266

Earlier quoted context omitted.

For other people who are curious POCO stands for "Plain Old CLR Object" So I think just a basic uninhereted object.

Typically also implies that the object contains no real logic/functionality and is a simple container for storing some values. Something that could be a record type.

I think of "plain old" as meaning "not having dependencies on any framework" as opposed to "not inheriting from anything" or "not having logic".

Re: .NET 5.0

#428

Earlier quoted context omitted.

Thing is, you can do it but with ceremony. You have to override Equals() and GetHashCode() for starters. Then you also need to make sure you only have getters and no setters (or private setters). In some cases you need to make your empty constructor private and force a specific constructor to be used. If you have multiple constructors it means you will have different invariants which puts you in class land, you are b…

I also want to stress that this is per class . Which in reality is madness. If you have just 50 immutable classes you have to replicate those 50 lines of boilerplate for each class and make sure it's bug free. It clutters your classes up and it's just plain gross. It's going to be way better that the platform supports this kind of data structure natively instead of us building out the monstrosity ourselves. By the wa…

There is no correlation between lines of code and performance. Longer code is often faster, while short, succinct code is often slower.

Re: .NET 5.0

#429

Earlier quoted context omitted.

Gee.. Sounds like you have had an awful time of it. Any chance you could speak more of some of the issues you encountered? We are looking at cloud providers and was kinda leaning towards Azure.

My advice, stay the f*ck away from Azure as far as you can. It’s the biggest clusterfuck I have ever had to deal with. Unless you are a Microsoft Gold Partner and you simply buy every shit which your Microsoft Account Manager tells you then you have no reason to use Azure. Unlike the Google Cloud or AWS, Azure has not a single service which is unique or good in any particular way. On the other side, they have many se…

> Functions, Web Apps, Storage, Application Insights

What are the issue with these? What's missing/could be better?

Re: .NET 5.0

#430
post #361

Earlier quoted context omitted.

Smells like you're not doing DI properly :)

Is it a bad design, if it could be held wrong?

You can hold pretty much anything wrong. Sometimes the onus is on the user to understand the tools. Sometimes the onus is on the tools to not be unnecessarily dangerous. DI is a well understood pattern, it just takes some time to wrap your head around it.
Post reply on HN