Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!


p a {
text-decoration: none;
background-image: -webkit-linear-gradient(top,#fff 50%,#3a3a3c 50%);
background-image: linear-gradient(to bottom,#fff 50%,#3a3a3c 50%);
background-repeat: repeat-x;
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#ff3a3a3c', GradientType=0);
background-size: 2px 2px;
background-position: 0 1em;
}

return outstanding;
return $outstanding;
class Gamma {
private final Account _account;
private int importantValue1;
private int importantValue2;
private int importantValue3;
private int inputVal;
private int quantity;
private int yearToDate;
public Gamma(Account source, int inputValArg, int quantityArg, int yearToDateArg) {
_account = source;
inputVal = inputValArg;
quantity = quantityArg;
yearToDate = yearToDateArg;
public int compute() {
int importantValue1 = (inputVal * quantity) _account.delta()();
int importantValue2 = (inputVal * yearToDate) + 100;
if ((yearToDate - importantValue1) > 100) {
importantValue2 -= 20;
}
int importantValue3 = importantValue2 * 7;
// и так далее...
return importantValue3 - 2 * importantValue1;
}
}
}
результирующий код может получить дополнительную нагрузку за счёт вызова нового метода. Однако, в наше время быстрых процессоров и хороших компиляторов, такая нагрузка вряд ли будет заметна
Всё, что вы хотели узнать о рефакторинге, но боялись спросить