Loved that post, certainly some things in there that made me think such as the vector destructuring of first and second. Going to adopt some of those principles for myself :)
Agreed on the destructuring in for and let, love the names.
But I've always felt that using destructuring on function parameters is not such a good thing because it makes it complex to read. Does anyone else agree with this? Maybe spec will change this somewhat?
I think it depends on context. If it is obvious or somehow documented what the parameters are, then it's fine. For example in in my codebase at work, most of the functions in a namespace take the same arguments, so if you read some of the rest of the code then it's pretty clear what the shape of the data actually is. We also use spec as much as possible
4
u/Severed_Infinity May 24 '17
Loved that post, certainly some things in there that made me think such as the vector destructuring of first and second. Going to adopt some of those principles for myself :)