Cédric Beust went off on a rant about refactoring (specifically, renaming classes) in dynamic languages yesterday:
All the Smalltalk IDE did for renaming was search and replace, which is, frankly, the best it could do. And clearly unacceptable today.
It's simple, really: dynamic languages that are not statically typed (i.e. let you get away with not typing variables) simply *cannot* do certain refactorings, among which "renaming".
Pulling up my BottomFeeder development image, I spot class Text - specifically, the one in namespace XML (as opposed to the one in UI). I go ahead and rename that to XMLText, and then go look for class Text in namespace UI - and there it is, blissfully not renamed.
It seems that in VW Smalltalk, renaming is scoped by the namespace of the class in question. So - in practice (as opposed to theory), you'll be putting your new classes into namespaces - and you'll be disambiguating by using namespaces. So... any renaming of classes that you do will "just work". Can you come up with edge cases that will break? Almost certainly. Will you actually run into any of them? Probably not. In many, many years of Smalltalk work, I can't recall getting bitten by renaming a class - and most of those years preceded the introduction of namespaces.
Sure, code that's not loaded won't get that (or any other) refactoring, but that has to do with the image based environment - something that also makes renaming much, much faster than running over a bunch of text files. I hope Cédric feels a lot safer over there - I'll be busy being productive in the meantime, unworried over edge cases I won't hit.
Technorati Tags:
dynamic languages, smalltalk