- Feature Articles
- CodeSOD
-
Error'd
- Most Recent Articles
- Stop Poking Me!
- Operation Erred Successfully
- A Dark Turn
- Nothing Doing
- Home By Another Way
- Coast Star
- Forsooth
- Epic
- 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 mind boggles.
I keep reading about contractors being paid in full for garbage like this. How can I get one of these gigs? My clients all expect GOOD code that actually WORKS.
Admin
is that it?
Admin
Great, all he did was change the text for the email extension. I hope they didn't sell the word "supports" too much because in their case it means "it might work one day, but not quite yet"
Admin
I can see three WTFs. Please correct me if I'm wrong:
Handling the differet cellphone providers with an enumeration instead of using something more dynamically (or rather runtime-) configurable requires rebuilding the app when providers are added or vanish or when the name of their SMS handling server changes.
Moving from DNS names to IP addressing is most certainly not an improvement.
The "goto Label_005B" is particularly amusing. What weed was this guy smoking?
What did I forget?
Admin
Ok, sooo how will this even work? All smtp uses email's domain to understad where it's send to ... if you just put the ip of the mail server it would:
I too want one of this contracts ... being able to make whatever I like not worring about it working and being paid so much...
Admin
I only wish I could get paid buckets of money for code like this. The biggest WTF in the world is that anyone manages to get a pay check for a steaming pile that looks anything remotely like this.
Admin
What is this "goto" he speaks of? That looks handy. I think I will start using it... EVERY WHERE!
Admin
Umm guys. SMS means Short Message Service and is called "texting" in most countries.
Admin
TEXT IS NOT A VERB!
Admin
Most countries being England and the US? Here it's called smsen...
Admin
Admin
Admin
Admin
I work on an SMSC, my guess is the WTF here is that he didn't interface using SMPP, the industry standard for sending short messages like grown-ups.
Admin
Whoa, whoa, let's see a reference for that.
Admin
SMPP. Teehee you said PP. You should start sending your messages like a grown up.
Admin
Since the code was decompiled (not the original source code), is it possible that the decompiler added the goto? Or rather the original compiler translated break into goto (but didn't for the last one)?
Admin
Yes, and when William the Conqueror showed up on the shores of Britain in 1066 he found everyone speaking the same English we do today. Since, you know, the language never changes and words never take on new meanings and/or usages. Never.
CAPTCHA: craaazy
Admin
the label name is obviously generated by a decompiler. It didn't add any gotos, that's how switches wind up being compiled. You can see it yourself: write some code in java or a .net language, then use javap or ildasm.
Admin
All smtp uses email's domain to understad where it's send to ... if you just put the ip of the mail server it would:
Soooo... you don't actually know what an IP is, do you? When a mail server (or anything else) uses a domain name to route traffic, it does so by first using DNS to translate that name into an IP; the IP address is what's actually used to figure out where traffic should go. Domain names are just to assist humans.
Admin
Maximilianop: You can e-mail an IP address just fine. When you send an e-mail, it will try to get its mx record, if one does not exist, it will go to its A record. Or in the case of an IP address, straight to the IP and attempt the delivery.
The way this guy is doing it is not optimal, but if there is a mailserver on that IP and it has a default domain, it'll likely be delivered.
Admin
But more imporantly, GetEmailBasedOnCarrier IS a verb phrase, and yet the dickhead has a class called GetEmailBasedOnCarrier.
objects == nouns methods == verbs
(Yeah, I know, there are sensible exceptions to this rule, and I've written some of them myself).
Admin
Umm howcome everybody so far missed the wtf of the return type being object for a method that only returns a string value? Returning an object when you know the type of your return is retarded since you'd have to cast it as a string to use it (unless you are working in a non-typesafe language) Actually I think in C# this would fail to compile, I think it would need to read
to compile.
Admin
Yeah, that can happen. This looks like IL to C# using Reflector. The original code probably looked something like this:
The text1 name comes from the compiler also, which does not preserve names of local variables.
Admin
It is now. Language changes- deal with it.
Admin
Their code compiles. In .NET, every class implicitly derives from object.
Admin
Admin
My guess is the company didn't want to pay to send text messages.
This way the company can send all the text messages they want with out paying a dime. I know it's not the best way, but I'm guessing this was their line of thought. I had to deal with a situation exactly like this before.
Admin
Can you please not text in upper case, thanks!
Admin
All right, lets say this program is put into production and then the primary dies for good and a backup (if they have one) becomes active. Now the ipaddress might be different... oops got to recompile the code :)
Admin
Love to see something getting routed to: [some number]@null
guess making a default-throw thing is something for even better paid people ;)
Admin
Admin
This CodeSOD is lame.
@Derrick: Please never use decompiled code as a reference for cs skills ever again. :)
captcha: pointer
Admin
I'm not sure if I should feel stupid about this or not.
I wanted to have a service that did the same thing, and I was going to use the email gateways as well. Is there any reason why that is a bad idea?
Do they cut you off for overuse? Any idea what kind of threshold there would be?
It's a super-simple solution to a problem that can get really complicated. Do I want to deal with SMPP and pay a fee for every message? Heck no.
Admin
@TGV: Oh, as in smsen wesson? We 'Murricans know that name very well.
@Spoe: What, never?
@Verbal Kint: It's a method, not a class.
@Pawel: Any programmer should have realized that the carriers should be configgable. The non-code WTF is much bigger, though (the substitution of IP addies, making it much more fragile). On the other claw, maybe the contractor was just setting himself up for more work later, when the app needed "updating"....
@SuperJason: The guy who initially implemented a web-based email/SMS distribution system I once worked on, apparently didn't think it was a bad idea, nor did I, nor our boss. However, the carriers were configgable, including via the web interface (if you were logged in as an admin). The hardcoding is the initial "real WTF", followed by the bigger-WTF of the "ip calls".
Admin
Yeah, that was an example of the original code, not my code, though I love making all my functions return "object". Looks like I made a change to make Resharper shut up. I hearby vow not to introduce any more Resharper fixes :). Wait, why am I defending code I posted in a forum...
Admin
I verb'd (a noun) you verb s/he verbs we verb you verb they verb
Admin
if you can send these "text messages" on a cell phone, where do you plug in the damn keyboard? This seems dumb, I don't want to carry around my fully functional keyboard in my pocket when i want to send a "text message". I'll stick to carrier pigeons and telegraphs!!!!
</SARCASM>Admin
http://en.wikipedia.org/wiki/Wikipedia:Credibility
Admin
Admin
Bwauahuhauha. Here it's called either mensagem de texto or torpedo.
Admin
I live in Scotland and it's the same here... I believe it's also the same in Wales, Northern Ireland, the Republic of Ireland, Australia, New Zealand and sometimes in India :P
Admin
question for pondering: considering how similar (in function) pagers and sms are, how come they can't communicate with each other via some intermediate? Obviously a pager and a cell phone operate on different frequencies and protocols, but how come there's not a phone number you can SMS and it'll send a page, and vice versa?
Admin
Admin
They can't? I always assumed pagers where just mobile phones without the voice function. But then, having grown up in the mobile age, I've only ever seen a pager on /Scrubs/. I don't think pagers are used at all in Europe/Asia where SMS is ubiquitous, except maybe by emergency workers.
So how does a pager work if it isn't a phone? Are you telling me we have an entire wireless network just to support something no one uses anymore?
Admin
Quite my point ... Since when did this site started featuring non-production code ?
I am sure everyone here had written at least one demo app that wasn't configurable but hardcoded ...
Admin
Admin
Admin
fnubish ba ba toobish! Yukenbooo.
Admin
The witty riposte of illiterates down the centuries!