3 ms·
I agree that "function" is too long, but I'm not a huge fan of these arrow keywords because they're not very easy to type. But something like TextExpander would
by funkah 15y ago
I agree that "function" is too long, but I'm not a huge fan of these arrow keywords because they're not very easy to type. But something like TextExpander would make a simple fix.
- stdbrouw 15y agoNot easy to type? What kind of a weird alien keyboard do you have? :-)
- chc 15y agoThe arrows are easy enough for me. Middle finger hits the - or =, pinky hits shift and index finger hits >. It's drastically less finger-work than f-u-n-c-t-i-o-n-shift-(-)-space-{-}. The only languages I can think of off the top of my head with easier syntax for anonymous functions are Scala (a pair of parentheses is literally all you need) and Clojure (with its #() syntax), which both seem to have put a lot of effort into making them easy. In particular, Ruby and Python both require more typing. At their most concise: Ruby: -> {} Python: lambda:
- thezilch 15y agoYou may be stuck with your IDE: JavaScript: fu<tab><shift-)> function(){ <cursor> } Python: la<tab>: The remaining characters should be filled in by most modern IDE / IDE plugins.
- chc 15y agoThose are both still more work than ->, and you could make a shortcut for the arrow as well if it's so difficult. Anyway, my point is that I don't see why the arrow should give anyone with a normal keyboard layout an inordinate amount of trouble compared to similar constructs in other languages.