For me no. I have looked into popcorn.js today and could not convince
myself that it was more readable, maybe it's a question of history or
feelings (and to get used to it) but without being an expert in all
languages, I consider js to be a unique (clever) language, using the
arrow notation makes it look like others, this argument might look weak
but for js or others I am not a fan of the arrow notation... will not
make friends, I know
It is confusing right now whether the arrow proposal and do proposal are
distinct/exclusive or not
I read about popcorn (--> Herby) :
error: ( msg ) -> {
throw new Error( msg );
}
which should be
error (msg) {
throw new Error( msg );
}
Where is this specified ? And what happens with get: function() {.....}
or set ?
Le 14/03/2012 21:53, Allen Wirfs-Brock a écrit :
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
--
jCore
Email : [email protected]
Web : www.jcore.fr
Webble : www.webble.it
Extract Widget Mobile : www.extractwidget.com
BlimpMe! : www.blimpme.com
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss