r/elm • u/toastal • Jan 18 '17
Selecting a Platform: JavaScript vs Elm vs PureScript vs GHCjs
http://mutanatum.com/posts/2017-01-12-Browser-FP-Head-to-Head.html6
u/Zinggi57 Jan 19 '17
TEA is not composable, but through brute force. (..) The ways around this problem are fairly weak, and amount to, “don’t write components” (IE don’t intend your code to be re-usable), (..).
Paraphrasing "don't write components" to "don't write reusable code" is just completely wrong. Nothing prevents you from writing reusable code.
It just means that there is no silver bullet for reusable things, you have to find the right solution for each specific problem.
A general pattern would be nice, but there is no silver bullet (not just for elm, in general).
The package manger (..) actively prevents the publishing of code that binds to JavaScript. This (..) will leave gaps in functionality (..) .You can close those gaps yourself, but wont be able to share your solution.
This is a bit harsh. You can always share your solution via github or some other service, just not the official package manager. Tools like elm-ops-tooling or elm-github-install can help.
Also, if your package is really good and wouldn't be feasible to do purely with elm, it can be white-listed.
0
u/m_gold Jan 19 '17
The only thing I take issue with is characterizing Elm as a "thought prison". I guess this sticks in my craw because the implication is "but you could be writing pattern guards and where clauses and return-ing a monad", when these things aren't all that important and they're certainly not laws of the universe. One of the things Elm has tried to do is show that you can leave out many of these programming features, and deemphasize and rename the others, and you get something much nicer.
8
u/polux2001 Jan 19 '17 edited Jan 19 '17
I don't think that's the implication given that the example he gives just above is that of Applicative. Unlike pattern guards and where clauses, Applicative is not a syntactic feature. (I'm not sure what you mean by return-ing a monad so I can't comment about that one.)
If I understand correctly, his point is that Elm:
does not let you abstract over type constructors (thus you cannot write a function that works "for all applicatives");
does not encourage as a community the usage of words like "Applicative" and "Monad", which prevents you from learning more by reading non-elm litterature
I'm not saying I agree with his point, but I think you're mischaracterizing it.
4
u/brnhx Jan 19 '17
I think it's generally fine to critique and summarize Elm's strengths and weaknesses in this way. Discussions like this make the language and community stronger.
But I keep seeing this kind of thing:
This needs to stop. People can learn things and grow. We all did to learn Elm in the first place. Java developers (or JS developers, or designers, or or or) have legitimate skills. Let's stop criticizing them for not knowing things yet. When you stop assuming people are dumb and appreciate them for what they can do, you get a lot more out of life.
I doubt it was the author's intent to throw Java devs under the bus, but the effect remains the same.
/rant
(PS not a criticism of you posting this, /u/toastal. I just think this kind of thing needs to be called out.)