Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove outdated beta comments from main template #2305

Closed
vasily-kirichenko opened this issue Jan 20, 2017 · 13 comments
Closed

Remove outdated beta comments from main template #2305

vasily-kirichenko opened this issue Jan 20, 2017 · 13 comments

Comments

@vasily-kirichenko
Copy link
Contributor

// Learn more about F# at http://fsharp.org
// See the 'F# Tutorial' project for more help.

[<EntryPoint>]
let main argv = 
    printfn "%A" argv
    0 // return an integer exit code

C#/VB project templates do not contain such comments. Why we need them?

@cartermp
Copy link
Contributor

@vasily-kirichenko I agree - when I first started with F#, the first thing I did was delete the comments because they bothered me. I'm curious what others think.

@forki
Copy link
Contributor

forki commented Jan 20, 2017 via email

@smoothdeveloper
Copy link
Contributor

If we assume this is the first code seen by people who don't know anything about F#, I'd say it should be a simple program:

// Learn more about F# at https://docs.microsoft.com/en-us/dotnet/articles/fsharp/
// You can also try the tutorial project
open System

let greet name =
  printfn "Hello %s!" name

[<EntryPoint>]
let main argv =
  printfn "What is your name?"
  let name = Console.ReadLine()
  greet name
  0 // last expression in a function is always the return value

The idea is that we don't introduce special fancy functional stuff, we just make F# look like a python, it should feel familiar and intriguing but not too intriguing.

@cartermp
Copy link
Contributor

@smoothdeveloper I think that's a good idea from a learning perspective, although I'm not sure how that will be viewed for existing developers. Unfortunately, we don't have any data in VS about things like if people comment out or delete default stuff from templates, so there isn't a good way to approach this from a data-driven perspective.

@smoothdeveloper
Copy link
Contributor

@cartermp should we then keep

printfn "%A" argv

That is also something which seems odd in a default template, since we don't have data, we should try to make decision based on input from @dsyme

We had a bit of talk about defaults for existing developers (in my issue #2336) and it seems we don't necessarily optimize for seasoned F# developers (the nuget discussed there is not going to be used in large majority of the cases, there is no C# code around which exposes value tuples, nor much F# code using struct tuple notation, along same way it is unlikely C# newbies trying F# will understand why F# pulls that by default while C# doesn't, value tuple being a minor/special case feature, especially in F#).

Speaking of appealing to new users, I think having the same layout of project templates than C#/VB would be good:

image

image

image

  • Is it necessary to have many different Portable Library templates (C#/VB only have one)?
  • How much work would it be for Microsoft to bring WPF/Winforms templates / designers to F#?
  • I don't have the web workload, but I assume the same thing is happening, can the MS team who contributed templates for C#/VB contribute the same templates for F#?

Having all project template structure look the same among the three languages would be a 👍 to disarm the feeling that F# is something else than a normal / mainstream .NET language.

@cartermp
Copy link
Contributor

We could aim for a bit of parity, but unfortunately we lack the IDE tooling for Classic Desktop-style templates, and cannot support the same number of PCL profiles as C# and VB. We're always going to look different there.

@jhurdlow
Copy link

Speaking of appealing to new users, I think having the same layout of project templates than C#/VB would be good:

Having all project template structure look the same among the three languages would be a 👍 to disarm the feeling that F# is something else than a normal / mainstream .NET language.

^^^^
THIS!!!

This one thing alone is probably impacting adoption of F# more than anything else. When someone unfamiliar with FSharp gets their interest piqued and wants to take a look at it, the first thing a lot of them (Windows devs anyway) will do is File->New Project... Visual F#... and then they see the screenshot posted above. "So this language is only good for library code and CLI apps" they say to themselves. "Bummer, oh well, back to C#/VB for me". Thus ends their brief foray into the wonderful world of F# and functional languages. Ouch!

You want to know the first thing I did with the latest VS2017RC? File->New Project... F#.... WT?? "Where are the templates for web-sites, web-services, etc...? Why don't I see the same templates I see for C#?! Why, even when I click on 'Online->Visual F#' does it say 'No items available for Visual F# ?!"
(in VS2015, I was able to find some somewhat old MVC/WebAPI templates off the web that I use)

All this does is reinforce the notion that F# is just some niche academic thing that functional nerds play with to annoy their co-workers.

As what I would self-describe as somewhat advanced-newbie, I'm a big fan of F#, and even though I sing it's praises at work as much as I can, I'll never get buy-in with the other developers so long as this situation exists (lack of IDE tooling as good as that for C# is also an issue).

When you can supply them with good clean examples of what F# can do, it helps a lot. While the senior devs in my group grouse about me using F#, the junior devs are much more open to it. One of our junior devs asked me for help writing a web-service that could be called by a custom script he was working on to insert a row into a database, I showed him how quick and easy it was to do with a simple F# WebApi controller using a SQL Type Provider, and he thought it was pretty cool. Those kinds of templates should be available OOTB; not solely by spending time GooBinging through F# blogs to figure out how. Things like MVC, WebAPI, Suave, etc.. should all be OOTB. As for desktop-app templates, that would be tremendously cool also; couldn't the existing tooling be reworked to work with F#?

On the topic of comments: I wonder if the template GUI could have a "checkbox" to enable "beginner help" comments. This could allow the developer to decide whether they want them or not.

As far as whether to make "simple, python-like" templates or more "idiomatic" templates, I can see value in both. Simple ones would make it more readable to an F# newbie, but idiomatic would be more useful for someone truly trying to learn and adopt the language in all its fullness.

@dsyme
Copy link
Contributor

dsyme commented Jan 31, 2017

@jhurdlow Useful comments. I agree very much. The lack of a really compelling templates in-the-box (or even online) is really a big problem for adoption. The console app as the primary template sends a really bad signal, as does the lack of up-to-date ASP.NET templates.

There were many online templates for VS2012-13 but I believe many of these have not been migrated over time, as the community have moved more to other templating solutions (Forge, or Suave's own getting-started material, or ProjectScaffold). This particularly happens now that VS forms a slightly lower percentage of all F# developers - ideally people want templating solutions that are independent of editor tooling, and many experienced F# devs want ones that are more command-line driven. But none of that helps to convince C# devs (i.e. looking for click-me eye-candy to delight them :) )

@smoothdeveloper
Copy link
Contributor

Adding this comment: https://news.ycombinator.com/item?id=13546749

Not even just about web projects. Even standard GUI apps have no ready templates at least in VS 2015. Just Console apps. Even if guides online show how you can easily hack together both GUI apps as well as e.g ASP .NET Web API's!

I'd like to see some love there. These simple things introduces needless uncertainty about the language.

There are many relevant comments about F# on https://news.ycombinator.com/item?id=13544491

@cartermp
Copy link
Contributor

cartermp commented Feb 2, 2017

Lots of good feedback there. Also after some discussion with folks in the F# slack (@isaacabraham, @ReedCopsey) it sounds like there's a good opportunity to get WPF templates for F# with the XAML Type Provider in as well. I'm very much in support of that.

@isaacabraham
Copy link
Contributor

@cartermp I recommend a quick win which is just create an single file in VS2017 templates which has a link to my Learn F# book which has examples for WPF and ASP .NET Web API ;-)

@dsyme
Copy link
Contributor

dsyme commented Feb 3, 2017

@isaacabraham Do we know what's stopping the community from checking in new templates into Visual F#? They just need to go here - the format is pretty simple.

We have to be careful about quality - all templates would need to be regularly re-tested as each new edition of the Visual F# Tools is prepared - but the lack of templates is definitely retarding the growth of the language among Visual Studio users.

Perhaps we could start a movement (like the error messages one), with a governing issue to state and track the overall plan? I'd be willing to contribute to the plan if someone looked after the admin?

@isaacabraham
Copy link
Contributor

Sounds like a plan. Let me have a chat on slack to see who might be interested - if there's enough interest I'll create an overall issue to track it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants