3 ms·
> Just look at this: https://twitter.com/andy_matuschak/status/549268259871002624 https://twitter.com/andy_matuschak/status/549268259871002624 "A pragmatic and
by eru 12y ago
> Just look at this: https://twitter.com/andy_matuschak/status/549268259871002624 https://twitter.com/andy_matuschak/status/549268259871002624
"A pragmatic and intentionally non-abstract solution to JSON decoding / initialization that doesn't require learning about five new operators."
What's scary about operators? An API with five new functions doesn't cause the same amount of anxiety, does it?
- tolmasky 12y ago1. The operators are abstract (most people have never seen >>=). 2. Even IF they were functions, (say "bind" and "return"), the actual functions themselves are known to be hard to understand for people. 3. Needing to know these when all you want to do is grab google maps results is the worst place to encounter them. In JavaScript, you don't need to learn "anything", just call JSON.parse. Its fine to encourage learning. When you want to do something completely unrelated that takes no thought in other places though, its a bad place to enforce learning.
- jjoonathan 12y agoYou can't get to online documentation easily, the calls have a maximum of 1 or 2 arguments, you can't provide alternatives that pop up on autocomplete, and the syntax can be harder to visually parse. To be fair on the last point sometimes it can be easier to visually parse with operators, but not always. For example compare printf format strings where substitutions look like %f vs C++ output streams where they look like "<<x<<" which breaks up visual flow like nobody's business.
- eru 12y ago> You can't get to online documentation easily, [...] That's a problem with common search engine. A specialised API search engine can help there. See eg https://www.haskell.org/hoogle/?hoogle=>>= https://www.haskell.org/hoogle/?hoogle=>>=