- 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
CAPTCHA: venio. I need to drink some venio after that!
Admin
Eat shit. You're not in charge of defining what is appropriate or not to post on this blog.
Admin
Produce is chicken wing. With wing bark. No Qautk.
Admin
Admin
Careful. There was a Nagesh on here a while back, and I think he died from doing something very similar.
Admin
I'll take "Non-Subtle Attempts to Start a Flamewar" for 100, Alex.
Admin
It looks like gallier2 wrote the original code, and feels guilty for it. To make amends he's posted a super-efficient rewrite in the hope of saving his soul. He's bound to get shirty if you go and pooh-pooh his considerable efforts. I for one will be implementing his visionary rewrite just as soon as I can.
Now, where's the upvote button?
Admin
A word is worth 1,000 numbers.
Admin
Sounds like a state machine is in order here, which could indeed be implemented as a loop, minus the spaghetti.
CAPTCHA: nobis (we're all in this together I guess)
Admin
Admin
FTFY
Admin
You think you were polite? And did you follow the quotes in my post? There seem to be people who think that the original code was not that bad. May be they were joking, but having followed comments here for several years now, there's no doubt that there are people dense enough, to not get why the original code was a WTF. Furthermore, some people prefer comments with content. 'frist', "wooden table" and "bobby tables" comments have been boring since their first time they were posted.
Admin
preg_replace huh. Another Alex FAIL.
Admin
Well, yes. But if you do it that way, then if the calendar gets changed and the number of quarters in a year becomes three or five, you've got to make updates all through your code. Having a single public constant that's used to build your arrays lets you make a change in just one spot that can break all of your code at once.
Admin
Admin
Maybe you ought to read the comments more thoroughly, and read further down, where people have asked questions, discussed answers, and corrected themselves.
Just because someone is incorrect does not make them dumb... Generally it means they are not in possession of all the facts and have made some reasonable but incorrect assumptions to fill the gaps.
Then again. maybe you ought to just WTF off!
Admin
Adam Smith?? using Regex's to do anything and everything.
Why do I have a feeling this came from our company? :(
(Captcha: nulla - a function to set something NULL)
Admin
// Here be dragons!
Admin
/**
TRWTF is that if str has embedded quats then you need to excap it with something like a backslush...and deal with exapping backslushes in the string as well... single-quating isn't so easy.
Admin
I don't see why my original comment was not contributing towards that goal. It was not condescending and it contributed to the subject. That other comments were posted, that basically stated the same as mine, during the time I wrote it (I was interrupted while composing) is irrelevant (and as frits noticed, we're not on stackoverflow were such thing would have been noticeable).
Just because someone is dumb does not make them (in)correct...
Gaps filled with comments like I did.
Bye, bye
Admin
Looks like magic numbers to me.
#define THREE_THOUSAND 3000 #define THREE_THOUSAND_AND_ONE 3001 #define THREE_THOUSAND_AND_TWO 3002 ... #define THREE_THOUSAND_THREE_HUNDRED_AND_FIFTY_ONE 3351
if cint(val)=cint(THREE_THOUSAND) then bolMatch=true end if if cint(val)=cint(THREE_THOUSAND_AND_ONE) then bolMatch=true end if ...
Admin
Boobies!
Admin
Quickest meltdown in tdwtf history? Guy went to pieces so fast he took out Nagesh with the shrapnel!
(stolen, yes, but stolen with love)
Admin
I don't think the QUARTERS_IN_YEAR is all that dumb.
Sure,
probably adds nothing to the comprehensibility of the code over
I'm sure anyone smart enough to understand the code can figure out that 4 is the logical number of quarters and requires no further explanation.
But what happens when we get a little farther in the code and we come across a statement that reads:
Now a reader might well ask, Why 4? What is this counting over? What's magic about 4? But:
Admin
BTW, even seemingly obvious constants are not always so obvious. Like, how many weeks are in a year? Obviously 52, right? Well, not really, there are 52 weeks plus an extra day, 2 in leap years. My previous employer dealt with that by every 4 or 5 years having 53 weeks in the calendar.
Admin
Mommy! Mommy! He started a fight! He hit me back!
Admin
This post has been sponsored by your grade three teacher.
Admin
365%52 != 0 Years aren't composed of weeks - a given date is within week N of a given year, determined by Julian date and your conception of where the week is bounded. If your calendar of the year has a set number of weeks you're doing something wrong.
Admin
Admin
What is needed is to replace all time measurements and expressions by a simple integer counter of http://en.wikipedia.org/wiki/Planck_time since the Big Bang.
OK we might have to show it in hex instead of decimal, so it doesn't take up quite so much room.
Admin
This not a WTF. This is normally used when a old version of some config file used a config option with a spelling error. In a new version you fix the spelling error, but have a compatible option for the old spelling. This way you don't need to update all config files everywhere, but new files will be correct. This is called backward compatibility.
Admin
52 weeks in a year not being a constant is about as obvious as it gets.
Admin
Admin
I blame George Bush and Obama. They have not been taking their responsibilities seriously.
Admin
But there are two quarters in half a dollar and 20 quarters in a fiver. 40 quarters in a decade and two quarters in a semester.
You're making the assumption that this is about one whole object (i.e. one whole year). But if you want to change the program to work in semesters...
It's people like you that keep us programmers working whenever the world changes. Thank you.
Admin
Admin
#define NUMBER_OF_NUMBERS_THAT_A_WORD_IS_WORTH 1000
Admin
I've seen a few TDWTF articles over the years where someone posts new code to do whatever the article's code was supposed to. Unfortunately the code posted was broken too and in a too obvious way; and then people started posting their (for the most part completely wrong) solutions to a problem they didn't even understand. I think this last one regarded memory management in C, AFAICR.
There were obvious syntactic and logical errors all around but above all their code didn't even touch the requirements. I stopped reading after I saw that it was the freaking third page and people were still posting flawed code even after someone got it right on the end of first page. It was impossible to find smart comments in the middle of it all.
I believe frits is trying to discourage this sort of behavior here. It's sort of an unwritten rule, and I support it fully.
Admin
Admin
Yeah, well you're a big poopyhead too.
Admin
Oh, you mean, like obliterating any trace of monsters such as IE6 from the planet? I'd love to hear your proposals.
Admin
Yeah, that cint's a cunt, innit
Admin
That's what you think.
Admin
I say we take off and nuke it from orbit. It's the only way to be sure.
Admin
I don't, and now?
Admin
Hey, there's only room for one fake gallier2 around here, and I'm him.
Admin
Admin
Thank you to stand in for me, but I woudn't have come up with 'poopyhead'. I have to admit though, that I like it.
Admin
This one isn't fake (can be noticed in my approximative english and my overly pedantic rants).