@wilfredh
OK, so extract method is awesome and this feature is awesome. I’m about to complain about the lineEnding example, not the feature. That out of the way:
This is not a good refactoring.
The problem is that lineEndings are added all over the place instead of in just one or a few places. If we do wanna add lineEndings all over the place, which might be fine, we only make the code harder to read and more raviolified and indirect by wrapping OSPlatform in a self accessor. We don’t gain anything.
Smalltalk code easily becomes Ravioli City if you’re not careful. (I guess this is my own “module-scope functions over self methods” bias showing, also.)
In the example, there already is a self method for emitting newlines. The problem is that the other methods then don’t even use that method. The code violated DRY, an issue which was exacerbated rather than ameliorated by the method extraction.
Sandra@Sandra@idiomdrottning.org