Skip to main content

Posts

Showing posts from May, 2010

Micro Fluency

I’ve been having a lot of conversations at work lately about how comments are a code smell , and if you’re not writing self-documenting code , ur doin it rong . Then I found myself in a position I’ve been in quite a few times… The general description is this: I have a method that takes two parameters. The action the method performs is best written in English in the form “{SomethingTheObjectDoesWith} {parameter1} {On/With/For/SomeOtherPreposition} {parameter2}”. The only way to name the method is “ SomethingTheObjectDoesOn/With/For(parameter1, parameter2)” . It seems like I run into this situation too often. The API for all of the concerned code doesn’t necessitate building out a huge fluent interface for readability, but it would be nice to have things read just a little better in this case. An example is certainly in order. I have an ASP.NET server control that activates a certain index on an associated MultiView . In order to let client code know whether or not it activates an in...