- 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
Matt, you're a very angry guy and probably a bit of a twat yourself - that's what I like about you. You put me in mind of my directory of VBS files used to sort out this, that and the other - all so neat and tidy you can grok them in a jiffy (used every quarter or so, so it just makes it easy to re-use them when you need to).
I understand the premature optimisation argument but that is nothing to do with presenting your code acceptably - which you should ideally not even need to think to do.
Why do I always seem to get stuck with the code from the guys that all think it easier to just knock out whatever shite?
Admin
Whoops, I stand corrected. I was thinking 22:04 was 8:04 PM. We both made off-by-two errors.
Admin
Is it possible that somebody was coding under the influence of dosequis?
Captcha: acsi -- when ucinod is over-engineering.
Admin
So you have a choice - piss about trying to handle DST/summer time with a hundred different piecemeal corrections all over the codebase, or do it right to begin with and save yourself that biannual headache, while getting the ability to sell your product in the state next door as a free bonus.
It's so trivial to do it right that it's fundamentally stupid to do it wrong. The rules are really simple: A) Convert to UTC the moment you get the datetime.
This is also really easy to check up on during whitebox testing: If the date enters into the program without being converted to UTC, or gets displayed without converting to local, then you have a bug. It's much harder to review when you have a situation where sometimes datetimes need converting but other times it doesn't.
Most frameworks have these time conversion functions already implemented that read the system locale or have a config file, so it's easier to do it right in the first place anyway.
Finally, if you find out later on that your timezone convertor has a bug, you only have to fix code instead of code and all data so far. Correcting data is orders of magnitude more complex than correcting algorithm.
The right way is often much easier than the wrong way.
Admin
Admin
Admin
I really just don't see the point of UTC. It's been notoriously unreliable since its inception, and I can't have applications in the enterprise bear that kind of risk.
Admin
Admin
Thanks geoff, you talking against it was all everyone required to understand how important it was ;) geoff troll best troll !
Admin
You start from the assumption that anyone gives a f* as to what is written in the black box.
The truth is nobody does, it's a low-level tool and the only thing you expect from it is to do what the function /method name says, as efficiently as possible.
NO reason to using long var names.
AND, no reason to use long var names in ANY production code, there's a damn good reasons scripts get minified and code gets compiled.
damn phoolz.
Admin
If you need to code becaiuse of that, you just plain suck and it's your own damn fault !
Admin
Totally agree. If the case size is so important to you and changes so often, you really need to have it stored in a db or something. The real WTF is wokring through the night on something that has to be done by 8am.
Admin
Are you sure that code is going to compile :? Take a look at line 3 :)
Admin
His name as a variable is the next generation of A.I.