3 ms·
The 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
by chc 15y ago
The 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.