> Anyone competent with Javascript can easily read the first form
And anyone competent with any language implementing map can easily read:
users.map(user => user.name);
...without having to do any "skimming over" the noise. It's not a big difference, you're right, but it's the kind of little thing that, when you let it build up over time, gives you the "write-everything-in-triplicate" feel of Java 6.
Further, you have to be intimately familiar with Javascript to understand why this is necessary:
function fetchUserData(){
var self = this;
userService.fetchAllUsers()
.then(function(fetchedUsers){ self.users = fetchedUsers; });
}
or even this:
function fetchUserData(){
userService.fetchAllUsers()
.then(function(fetchedUsers){ this.users = fetchedUsers; }.bind(this));
}
as opposed to simply writing:
function fetchUserData(){
userService.fetchAllUsers()
.then(fetchedUsers => this.users = fetchedUsers);
}
And anyone competent with any language implementing map can easily read:
...without having to do any "skimming over" the noise. It's not a big difference, you're right, but it's the kind of little thing that, when you let it build up over time, gives you the "write-everything-in-triplicate" feel of Java 6.Further, you have to be intimately familiar with Javascript to understand why this is necessary:
or even this: as opposed to simply writing: