3 ms·
I'm not sure if this was linked fatously, but this is actually pretty good JS. - All functions - The functions are simple and decomposed into smaller function
by lucisferre 8y ago
I'm not sure if this was linked fatously, but this is actually pretty good JS.
- All functions
- The functions are simple and decomposed into smaller functions
- No usages of "this" (except one necessary one in an event handler)
- No ham fisted attempts at doing OOP with JS
Only complaints really are naming and code style is overly compact which would potentially make it harder to understand, but in this context I think that is ok. There is nothing overly complex going on here. The code seems reasonably easy to understand.
If there are criticism I'd like to hear them.
- criveros 8y agoshould be using fat arrow functions.
- lucisferre 8y agoWhat possible benefit would this have? Particularly considering it doesn't rely on "this" anywhere.
- rs86 8y agoJS is OOP, although does not have classes. It has prototypes
- lucisferre 8y agoJavascript works half-decently as a functional language but is a pretty bad OOP one. Pick your poison. Add to that the general consensus that functionally-oriented programs are easier to test, debug and reason about and you have my reasoning.