Hacker News new | ask | show | jobs
by sambeau 5453 days ago

  "Refactoring came to us from Java"
Maybe the word came from the Java community but people have been carefully restructuring code since code was invented.
2 comments

> Maybe the word came from the Java community

Nothing of refactoring came from Java or its community. The formalization of its concepts largely came from the Smalltalk community (Opdyke, Johnson '90; Opdyke '92; Johnson, Opdyke '93; Opdyke, Johnson '93), using unit tests to ensure refactorings don't change behavior came from the Smalltalk community and automated refactoring tools came from the Smalltalk community (Roberts, Brant, Johnson '97; Refactoring Browser http://st-www.cs.illinois.edu/users/brant/Refactory/)

In fact, as you may note both the concept and the name are older than Java itself.

The only claim to fame Java has in relation to refactoring is Smalltalk refugees reimplementing IDEs and refactoring browsers for it.

It didn't. The wiki tells us that it was first used in 1990, somewhat before Java was on the scene.

http://en.wikipedia.org/wiki/Code_refactoring#History

Right, http://books.google.com/books?id=1MsETFPD3I0C&lpg=PP1&#3... It actually came from Smalltalk, just for a change.
Actually, the Smalltalk community got it from Forth, where it was called "factoring" (no "re-"). See e.g. Leo Brodie's _Thinking Forth_ (http://thinking-forth.sourceforge.net/).
Well, Unit Tests also came from it (SUnit was the first Unit Test framework). Which is unsurprising, as refactoring without unit tests is quite daunting.

But JUnit did make them mainstream, and so did Eclipse' refactorings.

Interestingly, refactoring usually works quite well for functional Haskell code without tests just relying on the types. (Of course the types won't help you in more imperative sections of your code, i.e. it's hard to guarantee a specific order of actions in the IO Monad with types only.)
You mean just like in Java?
Yes. But the pure part of your program tends to be bigger in Haskell than in Java.
Smalltalk was famous for it.
Makes sense, I guess: Java was based on Objective C which was based on Smalltalk (and C).