-
Notifications
You must be signed in to change notification settings - Fork 92
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
Better first code example #226
Comments
Hi @adius and thanks for the comments. The example on the front page is something that has gone through many variations, and I fear it will always be something over which people will bikeshed. See:
If you want to present some alternatives and you can get a fair backing behind one of them, I wouldn't necessarily be opposed to changing the example (I can't speak for everyone else on the team). But please do check out the above discussions and understand the reasons why this example has been chosen. This discussion is not a new one by any means :). |
Haha, thanks for the references. I wasn't aware ... I pitched the idea already in the functional programming slack and folks seemed to agree that other languages have better examples and that the current one is playing into the hands of the sceptics. But yeah, really coming up with a better example is the hard part 😅. I'll mull over it the next weeks. Hopefully I'll get an enlightenment =P |
Going to close this for now to bump it out of my queue, then. |
For reference:
It's like saying "this is just an academic toy language for math problems"
where
syntax is not the best part of haskell.Defining something after using it feels rather stupid.
When you start reading you're like "mh, from which unqualified import was that function imported" until you reach the
where
: "oh, it's defined here.After I've already used it 🙈".
So definitely not a syntax feature I would present upfront.
I think we should rather present a short example where there is maybe a short function to generate some value (map, filter, or similar) and then do something IO related. E.g. http request, database read, …. Maybe use https://archives.haskell.org/projects.haskell.org/diagrams to generate a graphic.
People often have the notion that Haskell is too academic (https://news.ycombinator.com/item?id=8803128), therefore the first example should exactly counter this and not support it like at the moment.
Other languages have better examples. E.g. https://racket-lang.org does some GUI and web server stuff, https://elixir-lang.org presents messages and fault tolerance.
The text was updated successfully, but these errors were encountered: