SAFE-Stack / SAFE-template

dotnet CLI template for SAFE project
MIT License
283 stars 88 forks source link

Consider removing ToDo from the full template #402

Closed isaacabraham closed 3 years ago

isaacabraham commented 4 years ago

The ToDo app has many good things:

However, there's a second (and I would argue more important) use case that is missed here: creating new applications. To create a new app, you need to remove a number of types and files (in fact, I'm starting to think that we need a recipe for it!) and for a beginner this may be a bit of effort.

I think we have a few options:

  1. Create a recipe (cheapest option but worst end-user experience for creating new apps).
  2. Create a third template option i.e. full but no todo app (I would rather not do this)
  3. Remove the ToDo app and move it into a standalone github repo / project which we could build all sorts of cool things as a demonstrator app, like SAFE Search and the Bookstore etc. (This is my personal preference).
theprash commented 4 years ago

I just timed how long it took me to remove the to-do app code from full template and it was 5 minutes. But I can probably do this quicker than most because:

So I would estimate that for someone quite new to SAFE or this template, it would take at least 20 minutes to remove the same code and get everything compiling. That's a big inconvenience when making either a simple hello world or a new production app.

isaacabraham commented 4 years ago

If I think back to dotnet new Console etc. - they don't contain sample applications, they are designed to start a new app as quickly as possible.

ChrSteinert commented 4 years ago

+1 for VsVim btw. – no idea what I would do without it.

While I also like the idea of seperating samples and templates, I think that SAFE is special, because you will not add another dotnet new SAFE.Server or dotnet new SAFE.Client typically – do you?

Maybe a balanced approach would be to have the current ToDo app (with awesome and cool additions ;) ) as a "big" sample and have the Template stripped down even more, or, at least, not increase it's size.

kulshekhar commented 4 years ago

Would it be a good idea to document the steps one could take to convert a project, created using the minimal template, to a state where it'd be almost identical to the setup created by the standard template?

That would:

The thinking is that those who want to start a proper project are likely already experienced enough with the SAFE stack that they could easily understand and follow the instructions to have a setup they want to start with, within a few minutes.

theprash commented 4 years ago

@kulshekhar I don't think having a minimal to full recipe makes sense because it would take at least 10 times as long to do that compared to just deleting the to-do code from the full template. There are several big differences between the two versions. It's easier to start with full and delete what you don't need.

theimowski commented 4 years ago

What do you suggest trimming the sample code to for default option? How does the starting point after removing the TODO sample?

IMO the biggest advantage of having any sample application as a starting point of the default template is that it demonstrates how certain pieces fits together. A developer can get a big picture of SAFE just by browsing through the code:

Following opinion is not backed by any observations, but I think there are users that care little about the docs after they get to the dotnet new safe point, and rely strictly on what's in the codebase.

Anyway I understand the pain of removing boilerplate after creating the template. If we remove the TODO list from default option we need to make sure that the "quick start" and "introduction" sections in docs refer to and showcase the example code clearly.