Stub Button

Continued from JustInTimeProgramming ...

A blindingly simple optimization to Smalltalk's development environment is to add a "Define" button to the Smalltalk walkback window that is active when you get a "doesNotUnderstand" and the receiver is not nil. Press the button and the system compiles a stub method for you with a halt in it and continues. --KentBeck

... and here is an implementation for the VisualWorks with Envy and RB-Users StubButtonInVisualWorks

I also put one version for VisualWorks 7 on the Cincom Store.

This is standard in VisualWorks 7.1 -- DaveAstels

-- MarkusGaelli

I do this in Java all the time. I usually start with classes that have their methods spec'd out, but all that exists is a stub that throws a RuntimeException. As I test, I run into those exceptions and fill the methods in. I've discovered that my classes may not be "complete" in that they're missing implementation of some of the methods, but I've got enough functionality to support my current goal. -- RobCrawford

Or better yet, a NotImplementedYetException? extends RuntimeException, with "throw new NotImplementedYetException?();" bound to "niy" in emacs. Still, it is a terrible shame that one has to stop and recompile to do this. -- MartinPool

Of course if you were working in VisualAge for Java, you wouldn't have to stop and recompile :) --KyleBrown

Some Java IDEs (I use IntellijIdea) provide this during authoring as IntentionActions. No need to write the stub yourself.


EditText of this page (last edited May 2, 2003) or FindPage with title or text search