• ray10k (unregistered)

    Starting today, all TDWTF posts must be as short and concise as possible. F

  • Pjrz (unregistered) in reply to ray10k

    A? R. IC wht U mn.

  • (nodebb)

    This one database, they replaced the words name, code and flag everywhere with no, CD, and fly, because optimization.

  • (nodebb)

    I could just stare at that line all day. Also known as "working on a really difficult problem" while browsing funny stuff on the other screen

    Addendum 2018-12-05 07:25: Screw you, Mrak-down...

  • (nodebb)

    “Just fix the bugs,” Chaz said.

    One wonders (well, I do, anyway) whether Chaz bothered to tell anyone what the bugs were...

  • (nodebb)

    Given the obvious preference, I'm betting the guy's initials were M. C.

  • Jay (unregistered)

    I think i understand what's missing here. My guess is I'm not seeing some EF classes that are being referenced, so all these wierd object types are entities pointing back to the database. He's querying the database to generate an automated email. Msg is some kind of class that generates and sends an email.

    It's kinda clever, but I may just be halucinating from lack of sleep.

  • Jay (unregistered)

    I think"msg.Type = MessageType.SMS;" says it might be a text message sent out to people's phones? Please correct me if i'm wrong.

  • TheGreatObfuscator (unregistered)

    The bug is easy to spot:

    select y.First();

    is wrong. It should read

    select y.Frist();

    SCNR

  • (nodebb)

    I think i understand what's missing here.

    I notice that you didn't say, "Meaningful names."

  • annanonymous coward (unregistered) in reply to Jay

    yeah, this seems to send a text message, with m being an instance of class M, which seems to be short for Message and message, respectively. it seems to be pretty simple, prepare a message object to send off to some routines/apis/whatever that actually send the message, but the code golf is unnecessarily confusing

  • N (unregistered) in reply to ray10k

    TRWTFIITC

  • LongTimeListener,FirstTimeCaller (unregistered)

    I once worked on a piece of code where all of the variable names were:

    f ff fff ffff fffff

    where f was a swear word, and the number of f's was the coder's level of frustration at the time. :(

  • sizer99 (google)

    We had a guy who thought shorter code compiled faster and ran faster - the 'compiled faster' bit was true back in the 6502 days when memory was precious, disk was slow, and you could only parse at 1 MHz, but it's infinitesimal now. Ran faster was never true.

    So his brilant solution - write your code, then remove EOLs to put each routine on a single line. Now your file is only 10 lines long, super fast! And with 1-2 char variable names and no comments (they slow things down too) even more completely unmaintainable.

    He left in a huff because we didn't appreciate his brilliance (on other things too).

  • gumpy_gus (unregistered)

    Yeah, so maybe it's a bit confusing having SQL placeholders, C# variables, and SQL returned data getting stuffed into a C# object.

  • Anon (unregistered)

    With no description of what the program is supposed to do, I'd be tempted to simplify all the code to the following, then call it a day.

    return "Hello World";

  • Chris (unregistered)

    We've got a bit of that style of code in our codebase, parts that need a re-write if we can ever figure out what it does. I put it down to the original author coming from an era where file sizes were as important as memory footprints, and things were written as "efficiently" as possible. I believe that it's only in more recent decades that the focus has shifted away from such "efficiencies" towards readability / maintainability.

  • NoLand (unregistered)

    Now these are just classic, 1950s-style assembler symbols: You have an object, which appropriately starts with "m". Since this is just "m", it must be the God-object of sorts (read, your business). Then we have "mc", which is clearly the costumer object. Probably, there's also "nc", used to hold a count for "mc" (otherwise, I'd be disappointed) or, alternatively, used for the memory location (AKA "pointer" in newfangled "everyone can code" talk) of "mc". Finally, "C" is the costumer data, which is certainly true. All selfevident and self-documenting! (Hole-in-one, you may say.)

    Nothing to see…

  • (nodebb) in reply to NoLand

    So the business is a theatre?

  • - (unregistered)

    Can we keep the political snarks out please? It's nice to have a place where people aren't making lame references to the latest political crap simply because they're obsessed with an orange man living rent-free in their heads. I come here for computer-related WTFs with my morning caffeine, not clumsy attempts at virtue signalling.

  • (nodebb) in reply to -

    Aren't you trumping this up?

  • I dunno LOL ¯\(°_o)/¯ (unregistered)

    So it's McCode? Ba-da-da-da-daaaaaa, I'm hating it!

    Single letter variable names should be reserved for temporary scope stuff, like i/j for loop indexes, p/q for pointers walking a list, and n for a count. And by temporary scope I mean on the screen at the same time, 20 lines or less, then preferably the scope ends completely due to block structure.

  • (nodebb)

    What's hilarious is that the arguments derided here are the same arguments trotted out when I've been hauled into "code review" for somebody to throw hissy fits over my using System.Int32 instead of int. The time saved typing nine fewer characters is a rounding error and the result doesn't execute one microsecond faster. Don't even start on readability either; these shorthand mooks and their one-letter names are virtual spaghetti factories more often than not.

  • Albert-Ish (unregistered) in reply to sizer99

    Wow those statements remind me of the fun days of Microsoft BASIC on Commodore and Apple II machines.

    Variable name length and declaration order mattered since the interpreter had to search for them in the variable storage space.

    From memory:

    • inner loop counter variables should be declared as early as possible in the program to put them near the start of the search.
    • Two letter variable names would help with faster execution (and they made your program smaller so GOTOs would be faster!)

    Wow. Those were the days. Now I want to find those old magazine articles that printed out the advantages.

Leave a comment on “Golf Buddies”

Log In or post as a guest

Replying to comment #:

« Return to Article