- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
Admin
Admin
What kind of a blooming nitwit is this ssddfdfsdf dude?
Admin
My dream job would be to program in nothing but assembly language. Unfortunately, I've only had one job with significant amounts of assembly language programming.
Admin
INC A
For a moment I thought maybe here would be a CodeSOD I'd actually understand - but no, it's just another test of my woefully inadequate knowledge of Java.
Admin
Basar: base class for quasars, pulsars, etc.
Admin
Admin
I hope the translation from one language to another is a trend we'll see more of - perhaps if the WTF is originally written in C# the article will feature it translated into JavaScript. Can't see how that would cause any problem.
Admin
Except for parameters that could be better-named I don't see anything wrong here. It's likely been well-tested and works for a wider range of dates than the majority of date libraries would accept. For those who are keen to bring up the maintainability argument, this is code that doesn't need any maintenance. If anything it's far better than all the date WTFs we've seen on this site.
TRWTF is Java.
Admin
Yeah. With a good set of unit tests, this code will last nigh-forever. Only fix I'd make is to set a floor (say, 1800 or 1900) on dates to avoid Gregorian adoption hangover weirdness complaints and trap ID-10-T errors from people in many multi-calendar locales. (AIUI, most of the non-Gregorian calendars in use don't use a year number nearly as large as Gregorian years are for a sane value of $epoch.)
Also: TRWTF are RTC chips that only support leap years through 2099. (What do you mean that your hardware says it's Feb 29, 2100?)
Admin
Well year 0 doesn't exist anyway, so there's probably a bigger issue there (years go from 1BC straight to 1AD in the Gregorian calendar.) Because date math wasn't screwy enough!