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 heirarchy - Constructor Hierarchy. You have to have your constructors such that the ones needing a lot of services and in-turn those services needing a lot of other services need to be added to the service container and ensured to be instantiable. Essentially, you build a tree of your services and have to ensure that all your constructors have objects that can be instantiated or managed by the DI system.
.NET 5.0
351–360 of 466 posts
Re: .NET 5.0
#352Earlier quoted context omitted.
I can get behind the DI dislike, but how are callbacks and promises in nodejs better than async in .NET?
What’s not to like about DI? Makes it so much easier to wire up dependent services and refactor those wirings at a later time. If you don’t use DI you have to manually manage everything yourself.
Some feel it can be needlessly complex to troubleshoot such a system or gain understanding of it if you weren't one of the original authors.
Re: .NET 5.0
#353People who think this is actually cross-platform need to consider these points: * Debian can't package F# because it is built using MSBuild, and MSBuild is built using MSBuild. How can it be Microsoft doesn't have the resources to get it into a major distribution? * Microsoft won't commit to maintaining any cross-platform GUI libraries. You will be relying on some random community project. Compare this with e.g. Pyth…
How does bootstrapping work for other products in debian? GCC is built using GCC and cmucl is built using cmucl.
Re: .NET 5.0
#354So, 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…
Re: .NET 5.0
#355Earlier quoted context omitted.
> ASP.NET Core does push you strongly towards dependency injection, but it does not force you at all to use it. Their own documentation for making queries against SQL Server doesn't provide examples of how to do it that aren't using DI. "Just inject it" it just says. Thanks .net, super helpful. Maybe the docs are there, but I couldn't find them at all when I went looking.
using(var conn = new SqlConnection(" ")) using(var cmd = new SqlCommand(@"Query here", conn)) { conn.Open(); cmd.executeNonQuery(); }
Re: .NET 5.0
#356Earlier quoted context omitted.
Interested in what you mean by 'lot more advanced'? The optional nature of the typing can be very useful for the web for sure. From my experience that same flexibility means you can't do as much reflection at runtime as in .NET but I have been for the most part away from typescript for last couple of years, so be interested in any resources around this subject.
* Structural types rather than nominal * Type unions and intersections * Type guards * `keyof` operator * String and number literal types See https://www.typescriptlang.org/docs/handbook/advanced-types.... for more. There are a lot of utility types in the standard library that could not be expressed in C# as well. Reflection is very different. It kind of still exists, but in a very different way.
I’ve gotten used to typescript, but I still enjoy using C#. Some things I really miss in C# (limited operator overloading) that will never come to typescript (not because of the type system, but because of javascript source compatibility).
Re: .NET 5.0
#357Congratulations to the team but more than a year after the Surface Pro X shipped and there is still no way to build desktop applications for aarch64 using dotnet/vs2019 on the local machine. Windows on ARM has no native support for WPF, WinForms, or WinUI. Visual Studio 2019 running as x86 32bits application can't see the local machine as a target for aarch64 applications. When I asked microsoft, the response was to…
Meanwhile, this week launch three Apple products that come with a free toolchain and IDE tailored perfectly to the new architecture that supports old and new UI APIs. On the Windows side, Visual Studio is still a 32bit application, and as you have pointed out, on ARM, it supports basically nothing but the ancient Win32 C API.
Re: .NET 5.0
#358Earlier 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…
For other people who are curious POCO stands for "Plain Old CLR Object" So I think just a basic uninhereted object.
Re: .NET 5.0
#359Earlier quoted context omitted.
Each HTTP request in a Go webserver spawns a goroutine, and there is no need to think about "freeing up threads" since coroutines are not OS threads. There's also no need to leak the word `async` all over your codebase. The problem being solved here with async/await is also being caused by async/await.
The issue is that Go simply does not allow large classes of system which require direct and unfettered access to the operating system primitives to be built. I'm a huge fan of Go, but pretending the two systems are equivalent either is either disingenuous or belies misunderstanding.
Re: .NET 5.0
#360The future is very bright for .NET. It has the right raison d'etre - .NET is part of the growth story for Nadella-Microsoft. They already have you programming in their editors (VS/Code) and pushing to their VCS (Github). They're even teaching you the C# type system with TypeScript :) If they can just convince you to use their stack, Azure will win you over from AWS every time. As a result, I really wanted to adopt .N…
[1]: .NET on Non-Windows Platforms, a Brief History. https://two-wrongs.com/dotnet-on-non-windows-platforms-brief...