- 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
This is actually pretty clean, compared to some of my first coding attempts (which were in kindergarten)...
Admin
Admin
How did I know this was going to be VB?
Admin
Admin
Admin
Compile error: formattedComment not defined
Error: ToString (method) is used like a property
:-)
Admin
JPSoft batch:
Admin
Public Function StripNonNumericCharacters(ByVal sOrginalPhoneNumber as String) as String
End Function
Admin
Admin
The most accurate version of the 'i before e' saying is "i before e except where it isn't". Anything else is either going to be unrememberable or wrong.
There are so many exceptions to this "rule", I've never been convinced how useful it is (science, eiderdown, deity, seismic, Keith, caffeine, seeing, ancient, society etc etc etc).
Admin
Indeed it will blow up. Maybe the function that returns the 'clean' phone number returns an empty string if the number is not in the correct format to begin with. We can only hope!
Admin
I use for loops for everything! I use for loops for everything! I use for loops for everything! I use for loops for everything!
Admin
But my phone numbers are +44 (20) 7555-1234 and +881 (7) 5555-1234 !
How will I be able to enter them now?
Admin
Clear as water...
Admin
While I agree with you that the rule is almost useless, some of your examples are kind of WTF themselves. The rule is only meant for situations where the i and the e make a single sound. In science, society, deity and seeing, the i and the e are part of different syllables. Also, eider is Swedish, so you can hardly expect an English grammar rule to apply.
Admin
At least it uses stringbuilder, and doesn't use &=. Too bad he didn't go two down in intellisense...
formattedPhoneNumber.AppendFormat("({0}) {1}-{2}", cleanPhoneNumber.Substring(0, 3), cleanPhoneNumber.Substring(4, 3), cleanPhoneNumber.Substring(7, 4))
Admin
Reminds me of Duff's device.
Admin
Oh yea, English is such a clusterfuck of exceptions that it really is 'exceptional'. I have friends in Taiwan and Japan that I occasionally help with their English studies. Really makes you realize what a mess it all is when you try to explain it to someone and go "WTF..." in your mind. :)
Admin
Admin
Please supply me with a firearm and the coder responsible for this abomination. Then just close the door behind you and pretend you didn't see me today.
Admin
Shouldn't that address be:
For Loop Liberation Front 44 Front St. 2nd Floor Berea, OH 44017 USA End Loop
?? :\
(Uh, and the CAPTCHA was: transverbero .. what the heck is that? a verb with questionable gender?) :o
Admin
It may only be 10 inches, but sure smells like 1'
Admin
Admin
This FOR-CASE construct has been seen before on Daily WTF before I think. Really the only reason I can think of is to simulate line-numbers and most programs don't need them (even if they have them).
Admin
Bah, this is nothing. I perhaps some of the most horrendous legacy code I inheritted, I have a single function that I've so far reduced to 977 lines (was previously +1500).
At last count, there's over a dozen of non-const static locals (hooray for non-reentrant code).
There are: 7 while loops. 25 for loops. 27 nested switch statements. 81 cases for those switch statements. 261 if statements. 123 else statements.
As I said, this phone number loops is NOTHING. It's not a WTF, it's a meh.
Admin
Don't be silly. This is much more eloquent:
Admin
def bla(a): return '('+a[:3]+') '+a[3:6]+'-'+a[6:]
Admin
Awesome. I am applying for the domain name "thedailymeh.com". In the future please direct all of your submissions to me.
Admin
Reminds me of the welcome speech from the Commandant of the Defense Language Institute. He said that once we got into our courses, some of us might start complaining about how hard the languages are to learn and how weird they are, but really, none of them are as hard to learn or as screwed up as English. As an example, he asked if anyone could give the past tense of "I can go"? Not one of the 300 or so people in the room, including me, could do it.
Admin
It's a work in progress, each step I have to tread every more carefully to ensure I capture the true essence of what is ApplyPhoneNumberFormatting.
[image]Admin
fix'd
Admin
D'oh! What was I thinking?! Thanks for your help, I stand corrected.
Admin
Maybe, but his is metric.
Admin
Petition to name this XTREME CODING STYLE "Duff's Enigma"
Admin
Admin
If I'm understanding correctly...
Today, I can go, but yesterday, I could have gone.
Admin
English is not my native language, but how about:
Admin
Admin
[quote user="campkev"][quote user="Kermos"]
Reminds me of the welcome speech from the Commandant of the Defense Language Institute. He said that once we got into our courses, some of us might start complaining about how hard the languages are to learn and how weird they are, but really, none of them are as hard to learn or as screwed up as English. As an example, he asked if anyone could give the past tense of "I can go"? Not one of the 300 or so people in the room, including me, could do it.[/quote]
Sorry, messed that up:
I could of gone?
Admin
[quote user="Anon"][quote user="campkev"][quote user="Kermos"]
Reminds me of the welcome speech from the Commandant of the Defense Language Institute. He said that once we got into our courses, some of us might start complaining about how hard the languages are to learn and how weird they are, but really, none of them are as hard to learn or as screwed up as English. As an example, he asked if anyone could give the past tense of "I can go"? Not one of the 300 or so people in the room, including me, could do it.[/quote]
Sorry, messed that up:
I could of gone?[/quote]
Yep, you definitely messed that up...
Admin
If this doesn't make you cry, you have no soul.
Admin
Even VB6 can do it better:
Public Function ApplyPhoneNumberFormatting(ByVal phoneNumber As String) As String
End Function
Admin
Four responses, all different. Is the right answer even necessary to make my point?
Admin
Admin
Admin
Which would (now that I think of it) seem to lead to "I can have gone" as the correct answer, but since I went through three other possibilities leading to it, the original point of English being complicated in this respect does seem to have some validity.
Admin
No, someone came up with "I could have gone", it just isn't right.
Admin
Admin
Don't be mean, he did say he wasn't a native speaker, and if you've only heard it said, "could've gone" sounds a lot like "could of".