Fare the link maybe a little dated but, the compromise that it highlights is still very much valid. In that you are adding (all be it small) a barrier of readability because of the ambiguity be tween constants and functions. The sole point of that article was not about arrow functions but rather how that impacts the ability to read the code more effectively. Your point lacks empathy for the people whom may end up reading your code and rather puts the onus that its more important that its easier to write because of X. Further more the point made on the order of procedure is also still very valid in that I will have to wade through method definitions before I even get to see the procedure of the code making the readability even more obscure. It's the everything looks like a nail syndrome. Sure you are avoiding the need for 'this' but at what cost?
I'm not trying to say you are wrong, frankly if it's helping you who am I to say otherwise. That said you should at least acknowledge there is a cost to it, that may end up helping you to empathize with your users which I believe holds the most value and that is what I believe that link really did a good job of explaining. Maybe try giving it another read and you will see what I mean.
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
you are adding (all be it small) a barrier of readability
Ahh see maybe it's because I actually disagree with this in the article. That is why I suggested the content was dated. Because people weren't used to arrow functions. But they are so common place now. They are easily read by most people. And I find.them to be more readable than function. So that suggests "readability" is subjective.
The readability is also trending towards arrows and away from functions... So over time more and more people will prefer arrows.
To me, the latter is much easier to read. But I know readability is subjective. So I don't think anyone can make blanket statements saying one is "better" than the other. Because it depends on the person.
I can however tell you that the readability is trending towards arrows and over more time function will before less preferred.
In your example you are displaying a typical subroutine thus this does make sense but if you are making everything a subroutine than you are not conveying the boundaries of you application very well are you?
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
People often use the readability argument to argue against arrow functions. Not able to see what is and is not a function. That is just a matter of organization.
Put constants in one place, put functions in another. You should do this with or without arrow functions.
Cofounded Host Collective (DiscountASP.net). Cofounded Player Axis (Social Gaming). Computer Scientist and Technology Evangelist with 20+ years of experience with JavaScript!
Fare the link maybe a little dated but, the compromise that it highlights is still very much valid. In that you are adding (all be it small) a barrier of readability because of the ambiguity be tween constants and functions. The sole point of that article was not about arrow functions but rather how that impacts the ability to read the code more effectively. Your point lacks empathy for the people whom may end up reading your code and rather puts the onus that its more important that its easier to write because of X. Further more the point made on the order of procedure is also still very valid in that I will have to wade through method definitions before I even get to see the procedure of the code making the readability even more obscure. It's the everything looks like a nail syndrome. Sure you are avoiding the need for 'this' but at what cost?
I'm not trying to say you are wrong, frankly if it's helping you who am I to say otherwise. That said you should at least acknowledge there is a cost to it, that may end up helping you to empathize with your users which I believe holds the most value and that is what I believe that link really did a good job of explaining. Maybe try giving it another read and you will see what I mean.
Ahh see maybe it's because I actually disagree with this in the article. That is why I suggested the content was dated. Because people weren't used to arrow functions. But they are so common place now. They are easily read by most people. And I find.them to be more readable than
function
. So that suggests "readability" is subjective.The readability is also trending towards arrows and away from functions... So over time more and more people will prefer arrows.
Examples like:
To me, the latter is much easier to read. But I know readability is subjective. So I don't think anyone can make blanket statements saying one is "better" than the other. Because it depends on the person.
I can however tell you that the readability is trending towards arrows and over more time
function
will before less preferred.In your example you are displaying a typical subroutine thus this does make sense but if you are making everything a subroutine than you are not conveying the boundaries of you application very well are you?
People often use the readability argument to argue against arrow functions. Not able to see what is and is not a function. That is just a matter of organization.
Put constants in one place, put functions in another. You should do this with or without arrow functions.
I have no problems seeing what is and what is not a function.
In the case of currying... I find the
function
keyword to be much harder to read.I'm not fully understanding this