3 ms·
That's basically C# top-level programs[0]. IMHO, In C# these are a mixed bag, because once a project becomes more complex a file without a class looks out of pl
by yyyk 4y ago
That's basically C# top-level programs[0]. IMHO, In C# these are a mixed bag, because once a project becomes more complex a file without a class looks out of place, so it's a feature for beginners/very simple programs. It was controversial enough that VS eventually included an option to create projects without using this...
From the questioning around "needs to import basic utility classes", I'm guessing the feature following this would be something like C# implicit usings?
[0]
https://devblogs.microsoft.com/dotnet/c-9-0-on-the-record/#top-level-programs https://devblogs.microsoft.com/dotnet/c-9-0-on-the-record/#t...
IIRC C# doesn't have the complex main selection as in here because it relies on csproj files.
- pjmlp 4y agoWorking with both stacks, I really hope Java doesn't start going through the C# trends of fighting Python and JS on lines of code to produce an "Hello World" application. Next step, language changes for Jakarta EE/Spring/Quarkus/Helidon minimal APIs.
- yyyk 4y agoWell, ASP.NET (Core) was startup was not exactly intuitive. How many people could type it up without a template? Routing was also way more complex than necessary...
- kaba0 4y agoIf you have an anonymous class, it can’t be referenced from elsewhere (it has no defined class name) so it is strictly only for small projects, which is imo the correct choice. But it is easy to “name” it when the program have to grow.