This post originated from an RSS feed registered with Agile Buzz
by James Robertson.
Original Post: Have Compiler Will Travel
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
While I was at StS, someone was watching me code over my shoulder, and suddenly they noticed that I was declaring instance variables on the fly. No, not the kind where you declare it as a temp, then select it, and then tell the Refactoring Browser to turn it into an instance variable, the kind where when it prompts you what to do with an as-of-yet-undeclared variable, there's a fifth item in the list called 'inst var', and you just click it.
I thought everyone knew about the package found in the Open Repository called AddInstVarAtCompileTime. But I guess not. If you haven't loaded this, you really ought to. I didn't write it. Radoslav Hodnicak did. And Randy Coulman (who I'm privelaged to work with) turned it into a package. I just take credit for putting it into the Open Repository.
It really is handy. It's in some ways a very little thing, and in other ways, it has a subtle affect on how I work. I remember in the old days, there was more of a tendency to declare the class, and think about all of the variables I might need, and then try to code around them. Having evolved to a more test first/exploratory style, where you add each inst var as it becomes apparent you need it, this becomes very useful, and streamlines the way I evolve a class. I spend more time thinking and solving the problem.
Oh yeah, there's another thing this package does. This was added later, and it kind of renders the package name incorrect. After using this for a while, I got tired of referencing a class that doesn't exist yet, telling it its undeclared, then running off to declare it. It's a similiar pattern. So a sixth item was added called 'New Class'. This brings up Vasilli Bykov's excellent class creation dialog with the name of the to-be-declared var in there already. Again, more time by brain gets to spend solving the problem, less time manipulating the tools to get the desired effect.