- 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
Starting today, all TDWTF posts must be as short and concise as possible. F
Admin
A? R. IC wht U mn.
Admin
This one database, they replaced the words name, code and flag everywhere with no, CD, and fly, because optimization.
Admin
Addendum 2018-12-05 07:25: Screw you, Mrak-down...
Admin
One wonders (well, I do, anyway) whether Chaz bothered to tell anyone what the bugs were...
Admin
Given the obvious preference, I'm betting the guy's initials were M. C.
Admin
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.
Admin
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.
Admin
The bug is easy to spot:
select y.First();
is wrong. It should read
select y.Frist();
SCNR
Admin
I notice that you didn't say, "Meaningful names."
Admin
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
Admin
TRWTFIITC
Admin
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. :(
Admin
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).
Admin
Yeah, so maybe it's a bit confusing having SQL placeholders, C# variables, and SQL returned data getting stuffed into a C# object.
Admin
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";
Admin
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.
Admin
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…
Admin
So the business is a theatre?
Admin
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.
Admin
Aren't you trumping this up?
Admin
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.
Admin
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.
Admin
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:
Wow. Those were the days. Now I want to find those old magazine articles that printed out the advantages.
Admin
Heh, I remember working in a BASIC that allowed var names longer than two characters, it's just that only the first two characters actually counted for uniqueness....as I recall it was some weird Sharp calculator/computer thing , maybe this https://en.wikipedia.org/wiki/Sharp_PC-1401#/media/File:Sharp_PC-1401_high-res.jpg
Admin
No, those were the initials of the guy who took a hammer to this code.
Admin