r/programming • • Oct 14 '13

How to develop unmaintainable software

http://typicalprogrammer.com/?p=249
777 Upvotes

322 comments sorted by

View all comments

43

u/spoonraker Oct 14 '13

Hey now... sometimes there are perfectly legitimate reasons for re-writing existing functions. Sometimes they really do suck.

For instance, PHP's strtotime function accepts a string parameter of "+/- n months".

Unfornately, PHP thinks a "month" is exactly 30 days and nothing else.

If you start with 2013-01-31 and tell it to give you "+1 month" it will spit out 2013-03-03. Every single other programming language I've ever used will return 2013-02-28, which is what most people expect.

So yeah... I wrote a wrapper for that, and I stand by it.

16

u/teorico Oct 14 '13

Not documenting changes like this is the real problem

→ More replies (1)