- 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
tl;dr - dan rather just pist frost.
Admin
Passed as a perimeter? Sounds kinda edgy to me.
Admin
My favorite part is that it's version 15.1.
Admin
I thought we frowned on using student code as WTFs.
//CAPTCHA: "inhibeo" - the spell that causes Hermione to get nervous and put her robe back on
Admin
This function just skirts the issue...
Captcha: feugiat - feugiataboutit
Admin
Honestly it's a language parser, should be easy to do all numbers with little more code.
Go 1-9, then 10-12, then 13-19 becomes easy (nine) + (teen) After that everything else is easy 21, 31 are (twenty) + (one) or (thirty) + (one).
Yeah this function is a serious WTF, even in its name, sounds like the forgot to name it and just put the comment as the name.
Admin
I love how schizophrenic this is. On the one hand you've got a variable named "WORD_CONVERTED_FROM_A_NUMBER_PASSED_THROUGH_A_PERIMETER", but on the other hand you have "HX_373".
It's like a epic battle between overly long descriptive variable names and short, completely cryptic variable names, fighting for the soul of this function.
Admin
I can't wait for the future version that handles up to 10^8...
Admin
Admin
"Eightteen" for 18 would be better than "four" for 5, I guess... (see "bugs fixed")
Admin
Admin
I like the bugs fixed
"'Shortened name of the function due to errors on polling the function"
THIS IS THE SHORTER NAME?!
Admin
Enterprisey. Very enterprisey. Also shtupid.
Admin
At one of my previous jobs they hired a new guy not because he was qualified in any way for the job, but solely on the basis that he used to be a Russian rocket scientist during the Cold War.
Instead of doing the things required of his job, he spent 8 hours a day making calendars in MS Paint with various decorations for each month, printing them out, and handing them to everyone in the department. If he made a change to one month, he reprinted everything out again for everyone and went around swapping out the old calendars for the new ones.
He was fired in two weeks. For some reason, seeing this code reminded me of him. Good intentions, poor execution, completely irrelevant to the task at hand.
Admin
Yeah right!
Admin
One of my elementary school teachers told me if I am going to spell a word wrong at least keep the same spelling throughout what I am writing. Glad to see someone else took that lesson to heart. (yes, yes "perimeter" is a real word...)
Admin
I like the fact that the first bug fixer could spell "three" but thought "eleevn" was a perfectly acceptable number.
Admin
THE BUG FIXES! THE BUG FIXES!! OMG, THEY DO NOTHING!!
Admin
TUDUM TSS!!!
Admin
Admin
He meant definitely "parameter" when writing "perimeter". Then it starts making sense.
Admin
Admin
Admin
Hahaha
Admin
Time for this programmer to enter the ranks of management and spend the rest of his/her career saying how "we used to do it."
Admin
If you ask me, whoever wrote it was just taking the piss. It would be worth the submitter's while, I think, to search for calls to this.
In code that's reachable from somewhere reachable, if you get my drift...
Admin
Ok Code challenge!
Challenge A: write one that can handle conversion of numerics to text without range failures (we can limit at somewhere around the millions? billions?) in the fewest lines possible.
Challenge B: write one that still gives the answer but in the most convoluted way.
Challenge C: By far the easiest, do one or the other challenges but in a way that we can't tell what you were going for.
Admin
I'm banking on this being just a joke. Evidence?
Considering that the EXAMPLE USAGE shows what we can guess was the previous function name, and how the new name is needlessly verbose... yeah.
Admin
Admin
True, but since this function was for a dictionary and spell checker, that makes it even more ironic!
Admin
get_comment_from_a_number_and_post_comment_to_function_and_submit_to_website_tdwtf()
Admin
Wow...
...How old is this code? Because I saw working code that would do this in a '79 or '80 copy of 'Creative Computing'.
Also, you can find working code online if you search for a one of the 'large' number suffixes plus the name of your favorite computer language.
For example, while searching for 'septillion c#', I found: http://www.vb-helper.com/howto_net_number_to_words2.html
Admin
Whoever wrote this code should be thrown out the window... of a orbital station.
Admin
In a degrading orbit or with exiting force?
Admin
One of Visual Basic's many useful features is an Eval function, which executes any text string you hand to it as code. The original author is probably using Eval, and has discovered a limitation on length for the argument.
Admin
Admin
Was this a problem, perhaps when 5 breeched rthe perimeter one was actually removed by security. This could be expected behaviour.
Admin
Admin
Admin
I learned it back when I was eleventeen!
Admin
Looks like something Nagesh would write; isn't that the type of Hinglish that he writes in?
Admin
Admin
Really? I didn't learn it until eleventyone.
Admin
I like that he replaces the empty string with that useless string...but only when the parameter is the empty string.
Because assigning literals to parameters is for suckers.
Admin
obviously a hoax, but a hilarious one :-)
the 'bug fixed' is the best part
Admin
Admin
p_comment = "Guys take it easy on him. He obviously never dealt with perimeters before and was just experimenting with this advanced technology. I'd like to see any of you implement a function that uses perimeters!" If p_comment = "" Then p_comment = "" Else p_comment = p_comment End If
Admin
I just appreciated the fact that the English output is still wrong.
[GrammarNazi] 13,387,281 rendered as words should read "thirteen million three hundred eighty-seven thousand two hundred eighty-one". Note that the word "and" is not in there at all, and tens are properly hyphenated. :-) [/GrammarNazi]
Also, to render numbers correctly as words (with the hyphens and everything) is a harder trick than you might think. Thankfully, standard English style dictates that you pretty much never spell out any numbers above nine.
So where would you need a library like this, unless your app writes checks?
Admin
Seriously, did no one else notice "forteen"
Admin
Firing's too good for this clown. I do believe a hanging's in order.