Jul 10th, 2013
As you might know I'm developing a lot of (public) APIs for other people. One good premis is:
the code is usually written once but read many times
One thing that I try to avoid for more than two years now are boolean function parameters. This article from Ariya Hidayat goes any futher and says:
it’s almost invariably a mistake to add a bool parameter to an existing function
I like this statement and I like to shout out to the Author Ariya Hidayat, who developed the esprima - javascript parser and phantomJS, which the sickest tool set I know for javascript, yet.
http://ariya.ofilabs.com/2011/08/hall-of-api-shame-boolean-trap.html
Update:
This is not directly related but a very good talk from Ariya about JavaScript parsing and its conclusions for tools and code analysis (this was the reason I got to esprima in the first place).