Skip to main content
5 events
when toggle format what by license comment
Feb 12, 2017 at 15:48 comment added Andrew Willems @Jules, just to clarify which curried function I was referring to in my comment above: As you implied, each instance of obj => key => ... can be simplified to (obj, key) => ... because later getX(obj)(key) can also be simplified to get(obj, key). In contrast, another curried function, (getX, filter = vals => vals) => (objA, objB) => ..., cannot be easily simplified, at least in the context of the rest of the code as written.
Feb 11, 2017 at 17:52 comment added Andrew Willems @JörgWMittag, thanks for your comments about the importance of types and for the link to that other answer you wrote. I use WebStorm and didn't realize that, according to how I read that other answer of yours, WebStorm knows how to interpret jsdoc-like annotations. I'm assuming from your comment that jsdoc and WebStorm can be used together for annotating functional, not just imperative, code, but I'd have to delve further to really know that. I have played with jsdoc before and now that I know that WebStorm and I can cooperate there, I expect I'll use that feature/approach more.
Feb 11, 2017 at 12:44 comment added Andrew Willems You've given me a lot to chew on: type definitions, meaningful names, using idioms...thank you! Just a few of many possible comments: I wasn't necessarily intending on writing certain parts as curried functions; they just evolved that way as I refactored my code during writing. I can see now how that wasn't needed, and even just merging the parameters from those two functions into two parameters for a single function not only makes more sense but instantly makes that short bit at least more readable.
Feb 11, 2017 at 10:56 comment added Jörg W Mittag +1 for types! Just because the language doesn't have them, doesn't mean you don't have to think about them. Several documentation systems for ECMAScript have a type language for recording the types of functions. Several ECMAScript IDEs have a type language as well (and usually, they also understand the type languages for the major documentation systems), and they can even perform rudimentary type checking and heuristic hinting using those type annotations.
Feb 11, 2017 at 3:52 history answered Jules CC BY-SA 3.0