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

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

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

 

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

 -Статистика

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


CodeSOD: The Date Wrapper

Четверг, 09 Апреля 2020 г. 09:30 + в цитатник

As we’ve harped upon many, many, many, many, many, many times: writing your own date functions is bad. Use the built-ins or a library or anything but your own awful string-mangling date code.

But you can and should wrap the date handling stuff in your own functions as convenient. That’s just good programming.

Krystian S inherited some code, which wraps date handling functions in its own abstractions, with method names like:

convertHHcolonMMtoHHcolonMMcolonSS(value);
convertDDdMMdYYYtoYYYYminusMMminusDD(value);
convertDDdMMdYYYspHHcolonMMtoYYYminusMMminusDDspHHcolonMMcolonSS(value);

That’s a lot of stray date formatting codes mixed with colons. If your colon is getting that jammed up, you might want to talk to a doctor.

[Advertisement] ProGet supports your applications, Docker containers, and third-party packages, allowing you to enforce quality standards across all components. Download and see how!

https://thedailywtf.com/articles/the-date-wrapper

Метки:  

 

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

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

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

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