3 ms·
What do you think about Joel's "Make Wrong Code Look Wrong" (http://www.joelonsoftware.com/articles/Wrong.html http://www.joelonsoftware.com/articles/Wrong.html
by greggman 14y ago
What do you think about Joel's "Make Wrong Code Look Wrong" (http://www.joelonsoftware.com/articles/Wrong.html http://www.joelonsoftware.com/articles/Wrong.html)?
In it he makes the argument that it's a good goal to make each line of code understandable with as little other context as possible.
Your `makeOutsideSubscriber` is fine when your in that module. But when someone else is using the module.
import subcribe
...
def SomeFunction
subscribe.makeOutsideSubscriber(...)
And then 3 months later someone comes and reads the code above using your module it sure would be nice if they didn't have to go dig through the source of your module and read the comments to figure out that it really means "make person an outside subscriber if all accesses revoked"
- crazygringo 14y agoIt's a good point. (And BTW I edited my comment to be "updateOutsideSubscriber" when I realized that was what it was really doing.) It seems to me that "make_person_an_outside_subscriber_if_all_accesses_revoked" just sounds like an internal module function. If something outside the module is calling it, it just smells like the whole thing is organized wrong. But sure, if the function is being used in a "global" way like that, then the full, long version is probably better...