• mjolnir (unregistered)

    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.

  • me (unregistered)

    is that it?

  • pitchingchris (cs)

    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"

  • TheRider (cs)

    I can see three WTFs. Please correct me if I'm wrong:

    1. 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.

    2. Moving from DNS names to IP addressing is most certainly not an improvement.

    3. The "goto Label_005B" is particularly amusing. What weed was this guy smoking?

    What did I forget?

  • Maximilianop (cs)

    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:

    1. Not work due to not finding corresponding mail server
    2. In case I missed the part of SMTP 101 where it's possible to relay to an IP ... how would the receiving server know where to host it into?

    I too want one of this contracts ... being able to make whatever I like not worring about it working and being paid so much...

  • foo (unregistered)

    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.

  • akatherder (cs)

    What is this "goto" he speaks of? That looks handy. I think I will start using it... EVERY WHERE!

  • Rik (unregistered)

    Umm guys. SMS means Short Message Service and is called "texting" in most countries.

  • Welbog (cs) in reply to Rik

    TEXT IS NOT A VERB!

  • TGV (unregistered) in reply to Rik

    Most countries being England and the US? Here it's called smsen...

  • TGV (unregistered) in reply to Welbog
    Welbog:
    TEXT IS NOT A VERB!
    Verbing weirds language.
  • bstorer (cs) in reply to Rik
    Rik:
    Umm guys. SMS means Short Message Service and is called "texting" in most countries.
    I think I speak for everyone when I say this is totally new information!
  • TGV (unregistered) in reply to Welbog
    Welbog:
    TEXT IS NOT A VERB!
    You're absolutely right. Verbing weirds language.
  • Charles (unregistered)

    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.

  • zip (cs) in reply to Rik
    Rik:
    Umm guys. SMS means Short Message Service and is called "texting" in most countries.

    Whoa, whoa, let's see a reference for that.

  • akatherder (cs) in reply to Charles
    Charles:
    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.

    SMPP. Teehee you said PP. You should start sending your messages like a grown up.

  • Anon (unregistered) in reply to TheRider
    TheRider:
    3. The "goto Label_005B" is particularly amusing. What weed was this guy smoking?

    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)?

  • Spoe (unregistered) in reply to Welbog
    Welbog:
    TEXT IS NOT A VERB!

    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

  • Frostcat (unregistered) in reply to Anon
    Anon:
    TheRider:
    3. The "goto Label_005B" is particularly amusing. What weed was this guy smoking?

    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)?

    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.

  • The Anonymous Coward (unregistered) in reply to Maximilianop

    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:

    1. Not work due to not finding corresponding mail server
    2. In case I missed the part of SMTP 101 where it's possible to relay to an IP ... how would the receiving server know where to host it into?

    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.

  • dnm (unregistered)

    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.

  • Verbal Kint (unregistered) in reply to Welbog

    TEXT IS NOT A VERB!

    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).

  • WTFer (unregistered)
    Comment held for moderation.
  • Jimmy (unregistered) in reply to Anon
    Comment held for moderation.
  • BBT (unregistered) in reply to Welbog
    Welbog:
    TEXT IS NOT A VERB!

    It is now. Language changes- deal with it.

  • J (unregistered) in reply to WTFer

    Their code compiles. In .NET, every class implicitly derives from object.

  • dkf (unregistered) in reply to Maximilianop
    Maximilianop:
    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:
    1. Not work due to not finding corresponding mail server
    As long as the IP address is right, there's a strong chance that it will go to the right place. Of course, that's a massive proviso as it depends on these providers never ever changing their SMTP/SMS gateway machines' IP addresses.
    2. In case I missed the part of SMTP 101 where it's possible to relay to an IP ... how would the receiving server know where to host it into?
    Provided it's to a mailbox that is "local" to the receiving server, it will work. But is the gateway able to do the translation to SMS itself or does it go onward by SMTP internally first? Who knows, but if it is the second, delivering to IP will almost certainly break massively anyway...
  • CorporateFelon (cs) in reply to Charles
    Charles:
    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.

    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.

  • PS (unregistered) in reply to Welbog
    Welbog:
    TEXT IS NOT A VERB!

    Can you please not text in upper case, thanks!

  • pitchingchris (cs)

    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 :)

  • i1emming (cs) in reply to Jimmy
    Jimmy:
    Yeah, that can happen. This looks like IL to C# using Reflector. The original code probably looked something like this:
    private object GetEmailBasedOnCarrier()
    {
        string domain = null; 
        switch (this.MobileCarrier)
        {
            [..snap..]
    
        case SMS.EnumMobileCarrier.Nextel: 
            domain = "messaging.nextel.com"; 
            break;
    }
    return (this.PhoneNumber + "@" + domain);
    

    }

    The text1 name comes from the compiler also, which does not preserve names of local variables.

    Love to see something getting routed to: [some number]@null

    guess making a default-throw thing is something for even better paid people ;)

  • Rik (unregistered) in reply to zip
    Comment held for moderation.
  • Pawel (unregistered)
    Comment held for moderation.
  • SuperJason (unregistered)

    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.

  • DaveAronson (cs)

    @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".

  • Jimmy (unregistered) in reply to i1emming
    Comment held for moderation.
  • snoofle (unregistered) in reply to Welbog
    Welbog:
    TEXT IS NOT A VERB!
    Maybe, but VERB is most definitely a NOUN, unless it's being used as a verb:

    I verb'd (a noun) you verb s/he verbs we verb you verb they verb

  • brianpkennedy (cs) in reply to bstorer

    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>
  • Jimmy (unregistered) in reply to Rik
    Comment held for moderation.
  • Pawel (unregistered) in reply to DaveAronson
    Comment held for moderation.
  • H|B (cs) in reply to Rik
    Rik:
    Umm guys. SMS means Short Message Service and is called "texting" in most countries.

    Bwauahuhauha. Here it's called either mensagem de texto or torpedo.

  • frymaster (unregistered) in reply to TGV
    TGV:
    Most countries being England and the US? Here it's called smsen...

    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

  • morry (cs)

    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?

  • madjo (cs) in reply to PS
    PS:
    Welbog:
    TEXT IS NOT A VERB!

    Can you please not text in upper case, thanks!

    Me thinks he texted it with a mobile phone brick. You know, those big ones that didn't understand lower case in SMS.

  • Misha (unregistered) in reply to morry
    morry:
    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?

    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?

  • Nelle (unregistered) in reply to Pawel
    Pawel:
    The contractor itself called the application a "demo" which Jared decompiled. [...]

    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 ...

  • bobday (cs) in reply to Nelle
    Nelle:
    Quite my point ... Since when did this site started featuring non-production code ?
    Maybe you missed the last paragraph?
  • i1emming (cs) in reply to Jimmy
    Jimmy:
    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...
    I'm sorry, the remark on the 'better paid' was not ment for you, but for the orginal coder. I figured you posted the code the orginal coder writen, not you :)
  • -j (unregistered) in reply to BBT

    fnubish ba ba toobish! Yukenbooo.

  • -j (unregistered) in reply to BBT
    BBT:
    Welbog:
    TEXT IS NOT A VERB!

    It is now. Language changes- deal with it.

    The witty riposte of illiterates down the centuries!

Leave a comment on “Buzz, Cell Phone, Buzz”

Log In or post as a guest

Replying to comment #:

« Return to Article