|
|
|
|
|
by EdgarVerona
2557 days ago
|
|
This one's definitely a weakness I still have. I read that and thought "yeah, I do this in a lot of places and often end up regretting it." I think named parameters don't actually help, because the underlying problem with the boolean (aside from the mystery about what it means when looking at code calling it) is that it implies a potential separate "mode" of operation for the function. That the single function might actually serve two different purposes. It doesn't always imply that I imagine, but it's pretty likely. I'm guilty of this in my code, and I know that my code quality has suffered for it - for some reason, the way he put it in this article gave me a moment of introspection there, and it's something I'm going to try and take away from it and improve my own code with in the future. |
|