-Поиск по дневнику

Поиск сообщений в rss_thedaily_wtf

 -Подписка по e-mail

 

 -Постоянные читатели

 -Статистика

Статистика LiveInternet.ru: показано количество хитов и посетителей
Создан: 06.04.2008
Записей:
Комментариев:
Написано: 0


CodeSOD: Not to Contradict You…

Вторник, 10 Августа 2021 г. 09:30 + в цитатник

Sometimes, readers submit code and say, "every line is wrong!" Usually, they mean that every line contains a bad choice, or represents a bad way of accomplishing the program's goal, or there's a series of compounding mistakes.

David sends us a block which… well, yes, every line is wrong, because every line contradicts every other one.

/** * gets instance of Product Status object * * @return object Warehouse Supplier object */ function __construct() { $this->_price = new OrderValidator(); }

The only thing "correct" about this is that PHP does have you name your constructor __construct. Ignoring that, between the comment and the one line of executable code, not a single thing agrees with anything else. I'd suspect that this was progamming by copy/paste, but I feel like that'd be more coherent. It might be really bad AI generated code, but David assures us that this was written by an actual human.

[Advertisement] Otter - Provision your servers automatically without ever needing to log-in to a command prompt. Get started today!

https://thedailywtf.com/articles/not-to-contradict-you

Метки:  

 

Добавить комментарий:
Текст комментария: смайлики

Проверка орфографии: (найти ошибки)

Прикрепить картинку:

 Переводить URL в ссылку
 Подписаться на комментарии
 Подписать картинку