On Mar 13, 2012, at 6:20 PM, Rick Waldron wrote:

> Kevin, 
> 
> Over the weekend I applied David Herman's new tri-lambda syntax to Popcorn.js 
> to see how it would look and feel: 
> 
> https://github.com/rwldrn/popcorn-js/compare/tri-lambda
> ...

So when I scan the diffs and my eye pass over pairs of changes like:

-(function(global, document) {
+((global, document) -> {
or
-          var DOMContentLoaded  = function() {
+          let DOMContentLoaded = () -> {
or
-    Popcorn.p[ api ] = function() {
+    Popcorn.p[ api ] = () -> {
or
-    script.addEventListener( "load",  function() {
+    script.addEventListener( "load", () -> {

my eyes invariably go to the first line of each pair and I have a minor mental 
WTF moment when I look at the second line. Now some of this is no doubt a 
matter of familiarity, but does anyone really think that the second forms are 
more readable even with experience.  At least in western cultures, are brains 
are trained from a early age to recognize meaning in words. Symbols are far 
less common and symbol semantically meaningful symbol sequences are even rarer. 

In what way does this syntax help people read and understand code?

Allen
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to