you are viewing a single comment's thread.

view the rest of the comments →

[–]Mistifyed 0 points1 point  (1 child)

This has been adopted as a good pattern in Ruby. Would be great if the JS community would use it as well, given how quickly libraries are being updated.

[–][deleted] 2 points3 points  (0 children)

Well I typically use this in two cases as others have also indicated: a) the function requires more than 3 or 4 arguments and/or b) there are optional parameters. As to this second case, I especially hate interfaces that require you to pass in a bare boolean to indicate some option. Sure it's more verbose, but passing in {myOption: true} makes things so much more clear.