On Sat, Dec 31, 2016 at 2:12 AM, Max Goldstein <[email protected]>
wrote:

> Those in favor of where clauses, would you mind summarizing any arguments
> from the thread that do not rely on personal preference but concrete
> improvements to code readability or maintainability, in a way not achieved
> by Joey's suggestion? We are looking for code examples in which
> where-clauses either let you do something let-clauses don't, or are visibly
> superior to them.
>

I don't think that it is unreasonable to ask for 3 examples in which one
has real code expressed with *let-in* and the same code expressed with
*where. *The code should make it crystal clear that the where version is
simpler, more beginner friendly (for people coming from JS) and has a
better chance to be understood 6 months down the line.

Without these motivating cases, the argument would look dangerously close
to "I'm familiar with another way of expressing the same concept and I
think current Elm programmers and future Elm programmers should pay the
price of dealing with a more complicated language to cater to my needs."

I work best with pattern matching good code. If I have 3 distinct examples
I think I can pattern match the better pattern. :)

List.indexedMap (\i x -> let bar = f x.foo in g i bar) aList


Why is the above code better than

List.indexedMap (\i x -> g i (f x.foo)) aList


-- 
There is NO FATE, we are the creators.
blog: http://damoc.ro/

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to