I have been told that flag arguments(boolean arguments) are a bad thing because it complicates the signature of the method and means that the method does more than one thing.
An issue I have with this rule is what if I have a html factory class that builds raw html from arguments passed in. Then lets say I want an option to make the form element required. This would obviously make most sense as a boolean argument. But this is contradictory to what I have been told.
So my questions is: is this an exception to this rule, does this rule even make sense, or what is the correct way to do a required option in an html factory class?