You are currently browsing the archives for the refactoring category.
Пора подводить итоги нашего конкурса. Из всех опубликованных примеров я выбрал пять финалистов, которые можно найти чуть ниже. Теперь вы можете проголосовать за два примера самого кошмарного код. Свой голос вы сможете оставить до 27 августа.
What is the Worst Code?
COTOHA’s example (32%, 15 Votes)
Ikar’s example (36%, 17 Votes)
Dmytro Shteflyuk’s example (43%, 20 Votes)
Rage’s example [...]
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.