r/javascript • • May 22 '19

JavaScript Clean Code - Best Practices - based on Robert C. Martin's book Clean Code

https://devinduct.com/blogpost/22/javascript-clean-code-best-practices
542 Upvotes

112 comments sorted by

View all comments

Show parent comments

2

u/[deleted] May 22 '19

I'd rather have the code be explicit and clean

Separate parameters are explicit and clean.

-3

u/BloodAndTsundere May 22 '19

"Clean" is subjective so I'll walk that back, but this function call:

doSomething({ destination: object1, source: object2 })

is more explicit than this one:

doSomething( object1, object2 )

0

u/[deleted] May 24 '19

If it can take any object it is NOT explicit. You may want to look up the word in a dictionary.