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

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

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

 

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

 -Статистика

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


CodeSOD: Code Changes Over Time

Понедельник, 14 Марта 2016 г. 13:00 + в цитатник

Code changes over time. Most of what developers do is manage changes to code. Dana inherited some pretty awful PHP, and decided to take some time to improve performance and make sure any errors thrown by the PHP were actually displayed nicely for the user.

While looking at the file-upload module, Dana found this:

//$sze = 1024 * 1024 * 5; // 2Mb
[...]
$size = $_FILES['userfile']['size'];
[...]
//if ($_FILES['userfile']['size'] > $sze) {
if ($_FILES['userfile']['size'] > $size) {
    return 'Error';
}

This is code thats been changed. This is the sort of code that sits at the end of the bar, not making eye contact with anyone, and drinking shots of rotgut until it doesnt remember why its there in the first place. Theres a seedy story written in every line of this code block.

[Advertisement] Release! is a light card game about software and the people who make it. Play with 2-5 people, or up to 10 with two copies - only $9.95 shipped!

http://thedailywtf.com/articles/code-changes-over-time

Метки:  

 

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

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

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

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