As far as I've heard it does not exist e.g when it comes for ASP and I believe that what "OP" meant.
I may be very wrong here
For hello world with 29 tokens if i count correctly for C# vs 4 tokens for a Python program, guess where beginners have an easier time to fail?
I used to use LINQPad for that, now I don’t need to, VS Code and this new feature is enough!
You would of course still have all the usual ASP.NET configuration and DI setup to do though, so the impact would be rather limited.
I meant that (as I've heard) you cannot write big app using "top level style" only/mostly
It probably isnt going to reduce "the boiler plate" that people complain about
Having this feature aligns nicely with those use cases.
Its nice for beginners, not having to explain every weird word they see, but not much for professional development.
However managing complexity with various language features all over the project makes impact.
If you write a few programs per day for throw-away data manipulation or system maintenance or something, then no.
>he very sight of dependency injection configuration is cringe.
I'm curious - why?
Regarding Dependency Injection: It's very much suited towards enterprise web applications; and its failure mode is trying to get DI to work seamlessly in a non-web application sense (C# is a general language; and .NET supports console, GUI, and web applications) and once you get out of the we application thread-per-request pipeline, you find yourself hitting rough patches.
I use EF, but generally only for migrations, and use Dapper for all the actual access. This avoids a lot of the headache I've had in the past with EF tracking, lazy loading, and foreign keys. I also avoid using views for anything, even at work where I can guarantee with many 9's worth of certainty that I will always be using MSSQL. Part of this is because EF doesn't support it for Code-First, but part of it is also generally trying to be proactive rather than reactive and pre-generate anything I'd be using a view for. Being able to more easily switch providers and move to a different RDBMS is just a "perk" that I'll likely never take advantage of.
I despise the Microsoft DI system. I won't bother going into details, it just doesn't seem to work "right" (that is, the way I want or expect it to). On the other hand, I've used Autofac for years and just seem to "get" it, so I sometimes go to relatively great lengths to use it, even when the Microsoft version would have been a lot easier to get up and running.
As for DI it can definitely be used fruitfully outside of a web application, I suggest the book Dependency Injection: Principles, Practices, and Patterns if you’re curious. It covers examples from ASP.NET Core MVC to console apps to GUI.
C# 9 also brings top-level programs, which essentially eliminate all ceremony for the entrypoint[0] - an app can now be as simple as:
[0] https://dotnetcoretutorials.com/2020/08/30/top-level-program...