3 ms·
To quote the author: "Check out this one-liner I pulled out of the first .coffee file I randomly opened from our application: scores = (student["assignment_#{
by phzbOx 15y ago
To quote the author:
"Check out this one-liner I pulled out of the first .coffee file I randomly opened from our application:
scores = (student["assignment_#{@assignment.id}"].score for own idx, student of @gradebook.students when student["assignment_#{@assignment.id}"]?.score?)
That’s 160 columns of “readable code”..."
You can write a 160 columns of unreadable code in any languages.
If you guys enjoy coding like that, don't blame coffeescript.
You might be right however that it is "more tempting". For instance, with scheme, it's really easy to start using macro and redefining everything; or to nest lambdas into lambdas into lambdas "because you can do it and it avoids using variables".
Still, I think it's the programmer's job to write clear code, whatever the language.