You are currently browsing the archives for the refactoring category.
It is time to tally up results of our competition. From all published examples, I have chosen five finalists, which can be found just below. Now you can vote for two examples of a smell code. You can vote up until August, 27.
What is the Worst Code?
COTOHA’s example (32%, 15 Votes)
Ikar’s example (36%, 17 [...]
So… It’s time to finish refactoring the example. In part 1 I have prepared a class for extracting strategies. Let’s look at our code:
I am writing about refactoring again. I found a class that has a code which is not so clean as I want. I researched it and understood that I could make it better. It’s a good chance to demonstrate how to refactor code using pattern Strategy. Let’s go.
We have following code:
Today I have read the article “10 Commandments for Java Developers“. I was confused when I read the third commandment. Author said that the code was more readable in second sample then in first one.