- 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
The original definition of the meter was: One ten-millionth of the meridian of Paris from the North Pole to the Equator, measured at the mean sea level. Later the definition was changed to reference a physical prototype object, and later yet the meter was defined interferometrically and then most recently by fixing the numerical value of the speed of light in vacuum.
But seconds pendulums were never used. (Local variation in the acceleration of gravity would have made that completely unworkable as a definition even in the 1790s).
Admin
Admin
I've never understood why we just don't do everything in base 2520. Then at least we can divide by all single numbers 1-10 inclusive
Admin
Admin
Try instead:
Point is, not Gregorian or Julian Calendar changed, so date in both is continues, Gregory only from 24 February 1582. Julius still continue (in theoretical), but not sure whether still used anywhere after WW1
Admin
The spirit of the law is more importnat than the letter. There seem to be too many "text book junkies" in IT. These are the people that insist something is wrong (or right) because it follows some arbitrary rule. This isn't limited to development, but the whole Software Engineering process (and in fact any processes within IT).
For example, where I work we have some fairly high-overhead processes to deploy changes, and while I understand the necessity in controlling releases, there needs to be some flexibility in the process to allow reduced overhead for low-impact low-complexity changes compared to major releases. Then again, I could bag ITIL a lot, but I'm guessing that would start a messy punch up (possibly because the places I've worked ITIL has been badly implemented rather than being a bad methodology necessarily).
Admin
Admin
Admin
Admin
Some day I want to hear about a programmer hauling out that famous title when his local Pointy-Haired Boss assigns him to "go to the department planning meeting". "But PHB! Go To is Considered Harmful and has been since 1968! Are you trying to get in trouble with the Labor Relations Board for assigning me to hazardous duty without a concomitant salary increment?"
Then you sit back and wait while PHB looks up "concomitant" on Urban Dictionary.
Admin
Yet:
Seems like goto is a lot better than the endlessly nested If Thens.
And the only way to avoid it, if you really have to test one condition after another and can't use a loop or something, is to return.
But returning in the middle of a function is almost as bad as a goto.
Admin
Multiple inheritance is a can of worms. Multithreading is a can of worms. Spaghetti code is just annoying to read.
Admin
Now I realize that hard-coded values are bad. And I realize that arrays are no longer taught in our schools.
But doesn't this seem like something a handful of static arrays and a loop could be used to solve?
Rather than creating this mother-of-all-WTF's?
I mean, assuming that there isn't just a simple, better way to do this...
...like, maybe, send the XML date in UTC?
Admin
Or a restaurant might say 19:00~29:00, but if you want to return an invalid date that you picked up there you'll probably have a hard time no matter what time of night it is.
Admin
Why do on the computer something that is so trivial without one....
"Please enter the current time in GMT" ?
If the user fucks it up, it's their own fault
Admin
You can make this half as long with no nesting by deleting every "Goto done" and all but the last "End If" and changing all but the first If into and Else If.
Admin
With the words of "retaining the indenting", I can imagine there was a huge pool of nested ifs, and someone tried to tidy up by removing the time zones that's not needed.
Not exactly a WTF if their source control don't have "ignore whitespace when compare" option.
Admin
Admin
Well, in Dido's lovely little song "White Flag" there is this verse:
Which is rather appropriate in this case.Admin
I wonder what happens if you pass this an input that has "GMT+05:30" as its timezone.
Admin
I've always held the opinion that dealing with 18th century dates in Sweden was on par with a land war in Asia or going up against a Sicillian when death is on the line.
First they embarked on a gradual conversion from Julian to Gregorian of skipping leap days for about 40 years; realized about 12 years into that that they'd already fucked up; converted back to Julian; eventually took the 11 day hit like all the other nations that converted in the 18th century.
Admin
I don't agree. An intelligent programmer would never write something stupid like this, not even in their early stages. This guy is a dumbass, and even after 30 years of developing, he'll still be a dumbass and write such dumbass code.
Admin
WTF is that comments are missing at the end of each line.
Admin
Wrong. There is nothing wrong with calling return from the middle of a function.
A "break" in the middle of a loop is a goto in disguise however. Yours is more like a break; in a switch which comes from the curious nature of switch dropping to the next case even when it has been handled (a programming WTF).
This sort of thing can be seen in C code desperate to avoid using goto and nested ifs.
In C++ there is never a need to use goto, as you have proper closures in the form of destructors, as well as exceptions to break out early in the case of failures.
Admin
Using the phrase "rule of thumb" is also stupid. WTF that does that even mean? Are you sucking it and then rethinking the problem?
Yes, it's stupid to use goto, and when I see it, I immediately drop my opinion on the intelligence of the author all the way to zero.
So, now you know what I think of you.
Admin
Another dumbass.
Everyone who ever said this is a VB6 programmer, where you couldn't in fact exit a function without writing a "function = value" line at its very bottom.
Yet, dumbasses who think skipping a block of code with return statements would then rather wrap everything in some if-else blocks, or even worse, let a bunch of code execute unnecessarily.
There are better jobs for Kevin, Meep and you out there.
Admin
Current time gets returned.
Admin
Now, look at this dumbass. He's against using the keyword break, which is THE ONLY proper way to skip executing unnecessary code (which is why we break out of loops, you dumb fuck), and he wants to raise EXCEPTIONS instead!? We're wasting air on you.
Admin
You're obviously an idiot. Better stop posting on a site where thinking for yourself is considered normal.
Admin
You're an idiot. You raise exceptions when an error occurs, and then the call-stack is automaticaly unwound for you, calling all the non-throwing destructors on the way, unlocking any mutexes and closing any file or database handles you opened (or if you acquired from a pool, restores it to the pool).
Returning out of a loop when you have found what you were looking for is a valid action. Calling break to exit a genuine loop is valid, yes, but putting in a do...while(false) loop just so you can break out of it to get to the code outside the block is a goto in disguise.
throwing when there is no error, just because you want to break out of a loop is a WTF.
Incidentally, there are only 3 types of exception, and having exceptions run through the type system is WTF.
An exception is either:
Admin
Another WTF is to include a resource residing in a directory named after the 'developer' (https://thedailywtf.com/images/remy/scroll.mpe).
Admin
Admin
The best part is that it won't execute deeper than the first if statement because of the goto.
Admin
I'm not the guy who wrote that for you, but, turist, go fuck yourself. You're also posting your own fucking opinion, and you called everyone not using goto stupid. Same goes for this Cbuttius duche.
Admin
It used to happen in the old days that when you used Microsoft Visual Studio C++ wizard to create a service for you, the code it generated was very WTF'y and included gotos.
You're not meant to fix auto-generated code but I recall once going in and doing that anyway.
Admin
Admin
Captcha: I still think you're a nobis!
Admin
Oh, another idiot. This time even more moronic (not capable of very basic reading and undestanding)
Yep, sure, i'll go "fuck" myself. That is, of course, unless someone donates you a brain.
Admin
No he didnt! He said:
which is perfectly...
Oho, wait a minute!
Is it that time of year again already?
Admin
Admin
Admin
Example from http://cboard.cprogramming.com/c-programming/149162-goto-bad-idea-ever.html (thanks Boozer)
// with goto while (whatever) { while (something) { if (such_and_such) goto break_outer_while; actual_work(); } } break_outer_while:
// with idiotic flag while (whatever && !idiotic_flag) { while (something && !idiotic_flag) { if (such_and_such) idiotic_flag = 1; else { actual_work(); } } }
I myself have only used goto one time, but it did make the code easier to read. If you think never using goto is more important than readable code, then right back at you with the "you know what I think of you" snark.
Admin
Admin
Sheesh, with how often I see these ridiculous if-else chains, I think I'm going to have to make sure every programmer I work with in the future understands what a look-up table is and how to put one together.
Admin
Admin
I used to do some work for a bus company that had a 30-hour clock for its scheduling and timekeeping systems. This would actually be very useful: for instance, a shift that started at 2200 hours (10:00pm) Monday and ended at 0600 hours Tuesday would be counted as having ended at 3000 hours Monday. (As I recall, no shifts could ever start on one day and end after 0600 the next, but I suppose that there really was no reason that the clock had to be limited to just 30 hours.)
Furthermore, I notice that in my local paper's tv listings, a "day" is considered to start at 6:00am and run to 5:59am on what is officially the next day. This is certainly in accord with the usual viewer's idea that a show that starts at, say, 1am Tuesday is "actually, subjectively" just very late Monday night.