Replies: 9 comments
-
I think this is a very good discussion to have. Perhaps we could split it into two templates? One "guided" template for beginners, and one for more experienced users? There are a few other things I'd like to add to the discussion:
|
Beta Was this translation helpful? Give feedback.
-
Strongly agree re. the namespaces / modules. I feel |
Beta Was this translation helpful? Give feedback.
-
At this point the template will remain for .NET 5, but some changes could be made to accommodate a best practice. The comment-heavy approach is not something I would want to do. These template changes were made in response to a series of user studies for newcomers who were found to attempt to define a function when trying to accomplish a task, but ended up defining the function after the I'm very hesitant to include more comments than already exist, as user studies have shown that people tend to ignore comments and even documentation that explains this stuff and just try to write code, and if they're looking stuff up, hunt for the first code sample and tinker with it until it works. The more they have to read and the more concepts that are introduced, the worse it gets. The other alternative - no comments, just a |
Beta Was this translation helpful? Give feedback.
-
I'll agree with that of course, since my preference is no comments at all! In which case I would propose we trim the scope of this discussion back to just one thing: re-consider the naming of the "from" function and look at going for something like this: https://dotnet.microsoft.com/learn/languages/fsharp-hello-world-tutorial/modify |
Beta Was this translation helpful? Give feedback.
-
I'd vote for replacing let printHello name =
printfn "Hello World from %s" name
[<EntryPoint>]
let main argv =
printHello "F#"
0 Also, I agree with having a minimal console app template and a "getting started" template with all the comments and extra function people currently have to remove. I really like how Rust makes it easy to create a project (which is basically almost what we've had for F# before): fn main() {
println!("Hello, world!");
} |
Beta Was this translation helpful? Give feedback.
-
Yeah, the For folks who are interested, the motivation behind the change is here: #6785 Essentially, people new to F#, regardless of having .NET background, all tried to define a function after One approach could have been to improve the error message (without messing with other cases where it emits), but the simpler approach is to just telegraph the fact that functions are defined before they are used in the template itself. I'd like to try some user studies when .NET 5 is out again to see what people struggle with again. The hypothesis would be that this common problem would not happen anymore, and since the previous template didn't define a function, having it there helped them out. |
Beta Was this translation helpful? Give feedback.
-
Grammatically from whom is correct. As a software engineering primer this is terrible. If I had a vote (Oh wait I do :-)), I would go with your suggestion it makes one to one with the just the facts approach of the C# console app template. In VS we have the tutorial template for learning about F# language constructs. And that is likely where newcomers will need more hand holding.
The templates are open source and can be found on github here: https://github.com/dotnet/templates/tree/master/src/Templates/DotnetCore Please CC @cartermp and @KevinRansom on a PR to address this change. When and if that change makes it's way through the system, I will update our desktop equivalents in this repo to match. |
Beta Was this translation helpful? Give feedback.
-
Just to clarify @KevinRansom - the current templates are from user studies where people failed to figure out that functions must be declared before they are used. A follow-up is to do this kind of study again and see if it made a difference. Everything else is just opinions that people have. |
Beta Was this translation helpful? Give feedback.
-
@cartermp , that makes perfect sense too. |
Beta Was this translation helpful? Give feedback.
-
I wasn't sure which repo this should go against, please feel free to remove if it should live somewhere else.
I'm hoping to understand the rationale behind the changes to the F# template when running
dotnet new
in dotnet 5.0 and understand whether people feel it's worth making some tweaks.Firstly for context, here's the content from
Program.fs
when we do adotnet new console
:I guess my question is essentially - is this designed to help complete newcomers learn, or does it help the "average user" get up and running quickly from the command line and prove that they have a working environment?
If it's the former, I feel we could do a slightly better job. If it's the latter, I feel it's a bit bloated. I am very biased towards wanting something that does the latter personally, as I don't think the template is the correct vehicle through which to introduce people - but I appreciate that's my bias, so I've tried to give some ideas below on how it could be tweaked if this is intended to be an introduction for new people.
Initial ramblings (disclaimer: I'm trying to play devil's advocate here, I hope this doesn't sound rude!):
Suggestion if we want something to help people learn
I don't know whether my explanations here are correct as I'm quite new to it, but they hopefully give an idea of the sort of thing I'd envisage.
I imagine the namespaces/modules thing will confuse people if they're coming from something like C#, so if this is for introducing people maybe there should be some reference to that too?
I don't think the comments need to be this verbose to be useful, but just some simple tweaks like avoiding from/whom might be worthwhile if you didn't want to go this far.
Suggestion if we want to keep it purely as a quickstart template
Beta Was this translation helpful? Give feedback.
All reactions