Minor layout refactoring#322
Conversation
dmitrizagidulin
commented
Apr 19, 2016
- Wrapped code to 80 chars
- Extracted nested inner functions to module-level scope in lib/ldp.js
83ab0c7 to
5cfbda7
Compare
| } | ||
| }) | ||
| } | ||
|
|
There was a problem hiding this comment.
I am not sure that taking this function out is a good idea.
They have one particular purpose bound to one particular function, putting them out is a bit confusing.
I think I like them being well encapsulated in the scope of the function. Also, these functions may even disappear or should be in a library (like folder-to-rdf was initially)
There was a problem hiding this comment.
Defining multiple nested functions inside a function, and then calling them, is a pretty serious anti-pattern tho.
Feel free to move em to a separate file or module tho.
There was a problem hiding this comment.
I agree, it doesn't feel right.
Putting out a function in the middle of many others, doesn't feel right either.
Moving them in a file sounds great. Recently I keep on seeing this (the anti-pattern that you mention) happen more and more in other javascript projects that I am following
5cfbda7 to
c1c70d8
Compare
72398d1 to
25df835
Compare
|
@nicola how's this? I moved the inner functions in question to their own module file, |
|
Perfect @dmitrizagidulin! |