First. The second, it seems ... lacks confidence. Why call doTheBorder() if you donβt even know if you want the border to be drawn? IMO, you must argue that the border is really needed, and then call doTheBorder() with confidence!
... In addition, from a technical point of view: if doTheBorder() is in a closed API, the developer can call it in the distant future, and if the second style is used, they may wonder why the border was not working, despite their call for doTheBorder() . Of course, sometimes certain circumstances or restrictions or restrictions may dictate the use of the second style, but I would avoid it when it was possible.
source share