Хабр Курсы для всех
РЕКЛАМА
Практикум, Хекслет, SkyPro, авторские курсы — собрали всех и попросили скидки. Осталось выбрать!
void transactFunction() {
try {
transaction.start();
someCodeFunction();
transaction.commit();
} catch(Exception ex) {
transaction.rollback();
}
}
to handle button down
show button knopka
go to page 3
Hello World Souffle.
Ingredients.
72 g haricot beans
101 eggs
108 g lard
111 cups oil
32 zucchinis
119 ml water
114 g red salmon
100 g dijon mustard
33 potatoes
Method.
Put potatoes into the mixing bowl.
Put dijon mustard into the mixing bowl.
Put lard into the mixing bowl.
Put red salmon into the mixing bowl.
Put oil into the mixing bowl.
Put water into the mixing bowl.
Put zucchinis into the mixing bowl.
Put oil into the mixing bowl.
Put lard into the mixing bowl.
Put lard into the mixing bowl.
Put eggs into the mixing bowl.
Put haricot beans into the mixing bowl.
Liquefy contents of the mixing bowl.
Pour contents of the mixing bowl into the baking dish.
Serves 1.
UserRepository::getActiveConfirmedWithFilledCountryOrPhoneNumber() или $this->isGreaterOrEqualThenMinimalAgeOrLessThenMinimalAgeAndHaveParentPermission(self::minimalAge). Или это нормальные имена? :)isCanUsePaydFeaturesПросто canUsePaydFeatures.
WHERE u.active AND u.confirmed AND (u.country IS NOT NULL OR u.phone_number IS NOT NULL) перенесенное практически прямо из ТЗ — нужен заказчику зачем-то (а зачем не говорит) список активных подтвержденных записей с заполненными страной или номером телефона. Можно было бы применить цепочку фильтров к полному набору записей, но зная особенности реализации (обертка для MySQL) как-то не тру получится тащить всю таблицу (очень большую, допустим) с сервера БД и фильтровать его локально.getActiveConfirmedWithFilledCountryOrPhoneNumber: function () {
$this
->getActive()
->where( 'confirmed', 1 )
->where( 'country', Db::NOT_NULL )
->where( 'phoneNumber', Db::NOT_NULL )
}
function getFilled (array $filled) {
$this
->getActive()
->confirmed()
->whereFilled( $this->filterFilled($filled) );
}
function action_get_field (Request $request) {
$this->render(
$this->model->getFilled(
$request->post('filled')
)
);
}
вы создаете кучу маленьких асинзронных методов
public static async Task SimpleMethod()
{
Console.WriteLine(«Hello»);
}
…в ≈13–14 раз медленнее, чем вызов вот этого:
public static void SimpleMethod()
{
Console.WriteLine(«Hello»);
}
public static async Task SimpleMethod() {
veryHardQueryToDatabase();
}
// vs
public static void SimpleMethod() {
veryHardQueryToDatabase();
}continuationsА причём тут они вообще? Это же вроде как Mono-specific фича, реализующая дешёвые програмно-управляемые потоки (кстати, офигенная штука, надо будет как-нибудь статейку на эту тему написать).
Почти после каждой [моей] более-менее существенной правки, <...> Говорят, что код стал менее понятным, становится трудно найти нужную строку и пр.
На самом деле проблема кроется как в коде, так и в разработчике, который привык к коду.
Читайте код, с остальным справится компилятор