- 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
gotta love magic numbers
Admin
ewww....
Admin
"...thousands of codes...", hilarious.
Admin
4th!
Admin
I believe I've seen coders use this technique before.
I think they call it the "Job Security" method. Although, obviously, it doesn't work, since Noah got replaced. ;)
Admin
Peter had to make a willful decision to never consult a reference book, a website, a colleague... how did he manage to learn to code at all? Then there is the term 'granular' which is a really fancy-sounding word. It would make you believe that the person might know something about date and time functions.
Admin
This guy really didn't Noah what he was doing!
Admin
Running out of days... Priceless
Admin
I could do with more Saturdays myself.
I do not see the WTF. Is it the request or the code? I could easily go for both fitting.
Sincerely,
Gene Wirchenko
Admin
Ow... brain...hurts....
Math, Good!
Admin
Shouldn't this be daycount = 2 ? Probably a transcription error, but I wonder how many similar bugs there were? Nothing like reinventing modular arithmetic or simple division. Eesh.
[Note from Alex: Whoops -- anonymization typo]
Admin
Everyone knows that our days here are numbered. Why should our applications be any different?
CAPTCHA = register (Again! Alex must be trying to give me a hint.)
Admin
WTF! You'd think that learning division would be easier than copy+pasting all that.
Admin
Ladies and gentlemen, I present to you:
J O B S E C U R I T Y I N A N U T S H E L L
Noah is an absolute genius, plain and simple. I don't believe for a single minute that he didn't know how to do this the right way.
Admin
Who the hell is monitoring these developers? How do they get away with this? If I were Peter I would be wondering where the other hot steaming piles were.
Admin
Ok, that came out looking much better before I posted. Thanks, HTML, for killing extra spaces. Lets see if the forum software takes the extra step of safeing this! J O B S E C U R I T Y I N A N U T S H E L L
Admin
Is this job security? ...or is it for performance evaluations?
Employee: Noah
Number of Support Tickets Opened: 55908598095809550
Number of Support Tickets Closed: 55908598095809545
Number of Support Tickets Left Open: 5 (assuming he had at least some "real" problems)
Average Ticket Lifetime (Open to Close): 6.17 minutes
Recommendation: <font color="red" size="5">Raise</font>
Absolute brillant!
Admin
Speaking of transcription errors...
XXX
Admin
You have more faith in people than I do.
Sincerely,
Gene Wirchenko
Admin
Attacked by forum software again...
I just wanted to mention that the guy just assumes some value as the error code for 'values out of range' and hopes it gets caught somewhere upstream. Shouldn't he do something reasonable instead like throwing an exception?
But he would have to know what an exception is...
Admin
And Peter:
Employee: Peter
Number of support tickets opened: 6
Number of support tickets closed: 1
Number of tickets left open: 5
Average Lifetime: 20 minutes
Recommendation: Not as good as Noah
Admin
And not be using VB
Admin
Noah was obviously not the kind of guy who was good at noticing patterns.
Admin
sweet pun!!!
Admin
Well, it's Visual Basic (QBasic?), what do you expect? :P
Admin
Too bad this Noah didn't drown in the flood. It would have saved a few of Peter's brain cells.
Admin
I was wondering where the VB haters were. Thanks for showing up guys. And you're absolutely right, VB has absolutely no constructs for dealing with this problem in a simplified way. Thank God all other languages automatically de-stupid your code when you try to do stuff like this. Because after all, this would NEVER happen in C#.
Or...could it? Hrm, I guess it's possible that the problem is the "programmer", and not the language. Nah, that's just crazy talk.
Admin
No, he was a blockhead who was never taught modular arithmetic, and also never looked for a better way, even after programming thousands of lines of boilerplate code. Look at the first comment. He clearly thought there would be trouble if the client asked for finer granularity.
Client: Say, perhaps we could have a faster turnaround now that we want hourly granularity...
Noah: No! No! I've consulted with the finest minds of our generation! I'm telling you, what you ask for is against the laws of physics! You'll just have to wait while I code your request.
Admin
VB isn't the problem at all. The problem is no talent people looking to get into application development becuase "that's where all the good jobs are." VB's only downfall is that it became know as easy, which it isn't. As proof look at how many people use the language to write poor code.
Poor code is not language specific, neither are poor pratices.
Admin
So, I take it that this would have been a good replacement?
dayCount = totalHours / 24
hourCount = totalHours % 24
Or does VB not support modulus?
Admin
VB does support modulus:
hourcount = totalHours Mod 24
Nice and easy to read.
Admin
Now this is what I come here for: Real mind-blowing stupidity. Not that subtle stuff like we've been getting recently. More Noah!
Admin
Of course it does:
hourCount = totalHours mod 24
Admin
I would marry you if we lived in Vermont.
Admin
Would he get them from the internets?
Admin
VB, much like generic beer and America's Funniest Home Videos is an enabling technology for stupid people. It allows stupid people to do stupid things on scale that they couldn't accomplish on their own. While using VB does not make you a dumb programmer, being a dumb programmer does make VB your weapon of choice. That is unless you really don't know what the fuck you are doing, then its PHP all the way.
Admin
And as a bonus, he made his successor look like a friggin' genius!
Admin
A Paula Translation:
private sub GetDaysAndHours(byval totalHours as integer, byref dayCount as integer, byref hourCount as integer)
If totalHours = 0 then
return
end if
hourCount += 1
totalHours -= 1
if hourCount = 24 then
hourCount = 0
dayCount += 1
end if
GetDaysAndHours(totalHours, hourCount, dayCount)
end sub
Admin
Which makes VB the problem. Let's keep programming difficult and arcane to keep out the undedicated. Look at HTML for god's sake. How much time have we all wasted on other people's crap HTML? Even Java and C# are too easy, but at least there are errors to scare people off (Unsatisfied link error ... ; expected). VB is too readable, too inviting, too easy. Plus it sucks as a language (no short circuiting, 'shared' as static is borked, no break statement, etc).
Because jokes are easy to miss here: This post is only half-serious. The part about VB sucking as a language is true, the rest is a joke. I'm being sarcastic. See how quickly the humor degrades as it's pointed out?
Admin
Even if by some wierd quirk it didn't, here's the black magic modulus replacement (assumes daycount is an integer):
dayCount = totalHours/24
hourCount = totalHours - dayCount * 24
Admin
You forgot to put your flame suit on.
Admin
I figured most of the PHP guys wouldn't figure out how to get past the captcha thing.
Admin
No, don't hard code in numbers...you never know when the number of hours in a day will change!
Admin
[sarcasm]
<sarcasm>Too easy djinn? Go home and write everything in machine language then. Higher level languages do have thier place. Matter of fact I'm going to start that right now! Heh talk about job security, and no compiler needed!
</sarcasm>[/sarcasm]
I would agree with you about VB having limitations, but I wouldn't say it sucked. In capable hands the language is powerfull, but that goes for any language. VB does do a lot of handholding and for an experianced developer this often got in the way, but sucking? I think not.
And manni, umm, yeah, how bout them steelers? Err, Power tools!
Admin
True that.
<FONT color=#000000 size=6><FONT color=#0000ff>D</FONT> <FONT color=#ff0000>o <FONT color=#ffff00>u</FONT> </FONT><FONT color=#0000ff>b</FONT> <FONT color=#008000>l</FONT> <FONT color=#ff0000>e</FONT> <FONT color=#ffff00>T</FONT> <FONT color=#0000ff>r</FONT> <FONT color=#008000>u</FONT> <FONT color=#ff0000>e</FONT></FONT>
Admin
I think we should ban all programming languages and go back to using 1's and 0's. That way only people who are really dedicated will be using these computers. Shit, just take away computers and bring back the tablets.
Those that fear the evolution of technology and say 'See told ya that new fangled thingy is bad news' make me shake my head.
Think about it. The evolution of programming has been to abstract the past level of programming. Assembly removed the 1's and 0's, then some other language replaced that.
I would rant on but you know, I haft to pick up my hammer and pick and get back to the tablets.
Admin
Damn forum software didn't color the text right. If you quote my response, you'll see it's correct. You know what the real WTF is here right? Flightless birds. Seriously, does that make any sense?
Admin
Just wondering if the client either thought "Peter must be a genius"
or "Noah was a dumbass", what do you think?
Would have been funny if he "improved execution time" with some kind
of binary search:
if totalHours <= 480 then
if totalHours <= 240 then
.....
Admin
Ahh only partially, flightless birds that swim I can see, they just fy in a different medium, ex. penguins.
Now Ostriches I don't understand, but I hear they taste good.
Admin
But to avoid wtfs like today's programmers need to be taught military-style:
"Waddaya mean you can't write programs with hex-editor?Get to work you lame code-monkey!" [:D]