You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
using arrow function,this keyword and classes in place of normal function #168
we should update contributing guidelines to use arrow function, this keyword and classes over traditional function as they provide some good features of ECMAScript, provide more readability and allow a user to write less code.
I am not an active JavaScript developer. I can say that in Python, there is a movement away from classes (trying to do more in functions and less in OOP) and away from anonymous functions because normal functions are easier to understand (more self-documenting) and easier to test.
Hopefully active JavaScript developers can jump into this discussion and provide proper feedback.
it is not always necessary to use arrow funtions because along with benefits there are pitfalls also if one is not carefull about using them such as the this keyword behaves differently with normal functions and arrow functions.
i think the best is to use normal functions for object methods and use arrow functions for callbacks or methods like map, reduce, or forEach.
let's close this and let the contributor to decided the best possible design for the program let it be up to them to use arrow functions or calsses what we can do is that if something is not fine or if there is some another way to do that thing in more efficient way then we can ask them to change the implementation.
Activity
cclauss commentedon May 11, 2020
I am not an active JavaScript developer. I can say that in Python, there is a movement away from classes (trying to do more in functions and less in OOP) and away from anonymous functions because normal functions are easier to understand (more self-documenting) and easier to test.
Hopefully active JavaScript developers can jump into this discussion and provide proper feedback.
ayaankhan98 commentedon Jun 20, 2020
it is not always necessary to use arrow funtions because along with benefits there are pitfalls also if one is not carefull about using them such as the
thiskeyword behaves differently with normal functions and arrow functions.i think the best is to use normal functions for object methods and use arrow functions for callbacks or methods like map, reduce, or forEach.
itsvinayak commentedon Jun 20, 2020
@ayaankhan98, this issue is on hold for a long time should we close it (if not needed) or wait for other members to review
ayaankhan98 commentedon Jun 20, 2020
let's close this and let the contributor to decided the best possible design for the program let it be up to them to use arrow functions or calsses what we can do is that if something is not fine or if there is some another way to do that thing in more efficient way then we can ask them to change the implementation.