Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Proposal: Two console templates: console & main #520

Closed
tthiery opened this issue Jul 8, 2021 · 2 comments
Closed

Proposal: Two console templates: console & main #520

tthiery opened this issue Jul 8, 2021 · 2 comments

Comments

@tthiery
Copy link

tthiery commented Jul 8, 2021

I just watched the community standup and wanted to add my 2 cents on the debate about main vs. no-main console application template.

Onboarding new developers from Python, PHP, JavaScript or completely new background with a no-using, global-sdk-usings, no-namespace, no-main-method is a very valid goal. I am in for change. global-usings will change how C# programs and app models are defined and I like it very much.

However, do not forget what safety a traditional main-method console template brings to programmers with C, C++ or Java background (aka. fresh converts). Or us 20 year veterans of .NET itself. We like the explicit Main, the usings, the namespace because we expect it. We do not like too much SDK magic like global using System; or auto generated namespaces. Especially for the console app model which should be a vanilla app model (not be too flavored like a e.g. SwiftUI like DSL or a i-will-never-open-program.cs-in-wpf-app). And in sheer numbers we create so much more dotnet new console applications than the current batch of newbies.

What about the following proposal

  • dotnet new console with a modern single-line, no-using, global-sdk-usings, no-namespace, no-main-method variant
  • dotnet new main for our converts from C, C++, Java and .NET veterans. Just what we always had.
  • Adding a comment on the CLI to clarify the situation
    $ dotnet new console
    Creating Console Application
    Hint: If you prefer a console application with a traditional Main method, please use dotnet new main.

@KathleenDollard Hope that helps about the feedback you asked the community.

@vlada-shubina
Copy link
Member

Moved to dotnet/templating#3654, this one may be closed.

@tthiery
Copy link
Author

tthiery commented Aug 29, 2021

Closed as in moved to the right repo. Issue is still relevant as of today.

@tthiery tthiery closed this as completed Aug 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants