| « Prev | Page 1 | Page 2 | Page 3 | Next » |
Re: Useless Functions, Extreme Naming, and More
2011-10-30 21:57
•
by
twitter
(unregistered)
|
|
frist. hope the 12$ was worth it Alex!
CAPTCHA: nulla. if(obj == nulla) { return ""a;} |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 09:05
•
by
anon
(unregistered)
|
You're not only first, you commented 11 hours before the article was posted! #ninja |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 09:06
•
by
Matt Westwood
|
|
Re: Useless Functions, Extreme Naming, and More
2011-10-31 09:10
•
by
The Mr. T Experience
(unregistered)
|
|
TRWTF is listing "French" and "Gay" separately.
|
Re: Useless Functions, Extreme Naming, and More
2011-10-31 09:27
•
by
BentFranklin
|
|
In the 8th one the camel case is wrong. It should be:
public override void ManagerElations() |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 09:28
•
by
Gay
(unregistered)
|
|
TRWTF is listing my name and your name separately.
|
|
First time I see use of generic in code
Is this production redy code? |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 09:38
•
by
Alex
(unregistered)
|
|
You know, I think the last one is used in the DB/IDE we use at work: one of the syntax error message reads "You are missing a '*', a '*', an expression or a '*'"
Glad to hear the original coder of that statement found a job elsewhere |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 09:52
•
by
Fishertroll
(unregistered)
|
|
// 10/31/00 - removing voter registration duplicate verification
// ** this could be part of the reason that we // ** have been represented so poorly lately |
FTFY |
At least the comment is correct. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:26
•
by
Deus
(unregistered)
|
|
Hey! I speak Gay.
|
|
Looks like someone took their CS course explaining "magic numbers are bad" literally instead of in spirit.
I can see it being very important to change everything that says it uses X number of parameters to actually use Y. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:35
•
by
Matt Westwood
|
|
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:40
•
by
airdrik
(unregistered)
|
|
Obviously, the problem is with the abbreviated names in the hierarchy. They would be so much more readable if they were just spelled out:
There, so much more readable! |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:40
•
by
AerieC
(unregistered)
|
It seems to me that SimpleOfx is anything but simple, but I'll take a stab at this one: OFX Bank message server 1 statement turn rss teenage mutant ninja turtle real super bank transaction list status teenage mutant ninja turtle transmission. Do I win? (Captcha: opto. This property makes my opto nerve hurt.) |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:45
•
by
airdrik
(unregistered)
|
ftfy |
|
I've seen something similar to the last in a COBOL code section here:
Clearly someone who didn't understand that, in COBOL, ZERO and ZEROES are just different ways of saying the same thing. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:53
•
by
Utterly Confused
(unregistered)
|
|
>#define TASK_RATE_ONE_SECOND (TASK_RATE * 40)
What would this mean, the number of TASK_RATE tasks in one second? If so, yeah, this is 200 for a TASK_RATE of 5 ms BUT it should be computed as 1000/TASK_RATE ***CONFUSED*** |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:54
•
by
Bronie
(unregistered)
|
|
This is exactly reason why I don't like foreach - var tends to lose context.
What it should look like: foreach (SimpleOfx.OFXBANKMSGSRSV1STMTTRNRSSTMTRSBANKTRANLISTSTMTTRN ofxbankmsgsrsv1stmttrnrsstmtrsbanktranliststmttrn in ofx.BANKMSGSRSV1.STMTTRNRS.STMTRS.BANKTRANLIST.STMTTRN) |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 10:58
•
by
C-Octothorpe
|
|
That last one is eerily similar to the code-base I inherited about a year ago, except replace all the "safe" if blocks with try/catch blocks...
public static int StringToInt32(string str)Ahh, now that's a beaute! Or the single return variant: public static int StringToInt32(string str)Now if this "pattern" doesn't scream "I don't give a shit about the quality of my code", then I don't know what does... |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:00
•
by
C-Octothorpe
|
Oh silly me. I thought that was a list of languages, not genders... My bad. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:03
•
by
milleniumbug
(unregistered)
|
|
#define TASK_RATE (5) //Task rate in milliseconds
WTF? Comments in define! |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:06
•
by
Matt Westwood
|
+1 In order of presentation: "Male", "Neuter", "Female", "Indeterminate"? |
|
The GetStringValue example is not a WTF, but just the result of thinking about the same cases (reference could be NULL) multiple times.
I frequently get this when I code via automatic electroencephalography input and lose concentration for a while. Most cases are caught by the optimizer; but sometimes, garbage slips through. The optimizer removes it usually, but not always. I frequently get this when I code via automatic electroencephalography input and lose concentration for a while. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:09
•
by
Bronie
(unregistered)
|
"Both". Captcha: vulputate |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:09
•
by
Zune-Tran
(unregistered)
|
ZFTY |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:29
•
by
Matt Westwood
|
You wish. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:31
•
by
catdog
(unregistered)
|
|
The one from Ryan is not a WTF. The method may just return now, but could easily be a hook for something that needs to be done for the future. The try/catch is probably something they require as part of a process for all of their methods, and it's better to do it in advance than not do it, so later when someone makes the method do something, not only do they have to remember their task but they have to remember to add the try/catch when that's something they never have to do for an existing method. It's the same reason why coding standards saying to use curly braces on single line statements: because why make someone remember they have to do it later when you could just mitigate the risk and do it now.
|
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:42
•
by
Matt Westwood
|
Interesting how fashions change. There's lots of bollocks being talked about single line curly braces at the moment. I think it looks shit, by the way. Used to be that the Egyptian style, a.k.a the K&R style, was king. Now suddenly it's not. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:46
•
by
geoffrey
(unregistered)
|
The Only WTF is that they didn't leave the application in COBOL in the first place, but tried to convert it to C. In COBOL you don't have to write out the full parentage of a nested field like that, or have to bother with the ToString(). You would just write: move ACCTTYPE to M-ACCOUNT-TYPE |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:48
•
by
Steve The Cynic
|
Nothing wrong with comments in a #define. However, in the real world, "rates" are measured in Hz, not seconds. It should be TASK_INTERVAL or TASK_PERIOD or something like that. Well, assuming it really is in milliseconds, that is, and not work-units per unit of time. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:52
•
by
iToad
(unregistered)
|
So it has come to this... COBOL has become a better alternative than Java or C. That's just sad. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 11:57
•
by
frits
|
output: 5 ??? Addendum (2011-10-31 12:03): EDIT: My misconception, sorry. Steve is absolutely correct. At least I can leave pretty code to harrass those who like monochromatic comments. :P |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:00
•
by
trtrwtf
|
Style is fashion - do what everyone on your project does, it'll be okay. K&R is popular in books because vertical line space is expensive in print. On the screen, vertical line space is free, and if it's an issue it's an alarm bell: time to refactor. I prefer the One True Brace Style (Allman style) because it lets me line up the braces by eye, and makes the blocks more obvious. But whatever, in this world there are certainly bigger things to get worked up about. Single-line braces are a belt-and-suspenders thing, at best. If you're doing everything else right, they don't make a lot of difference, and they busy up your code. If you're doing everything else wrong, they're not likely to make a lot of difference, and they busy up your code. So don't bother, I say, just do everything else right. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:13
•
by
geoffrey
(unregistered)
|
Reminds me of a job I had 15 years ago. I was moved onto a long running project and found myself on the "team" of a real bunch of K&R apologists. Despite my best attempts to educate them as to the merits of single line quotes they forced me to use K&R. Joke was on them though, each day I would secretly convert pieces of the code from K&R to single brace (as well as making some other more aesthetic and functional changes/improvements). Then when they went home each night I would disable the source control notification system, force commit my changes (ie overwrite the repository - this was long before CVS even) and renable the system again. Slowly but surely the whole code base was improved (from the most obscure files upwards) and by the time they realized what had happened (weeks later) it was already too late to change it back. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:19
•
by
G-Spot
(unregistered)
|
foreach(comment.THATMAYHAVESOMEINTERESTINGCONTENT in comments.FROMTHEDAILYWTFFRONTPAGE) |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:26
•
by
Matt Westwood
|
What a shitty thing to do. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:29
•
by
trtrwtf
|
What, you mean responding to a troll? |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:29
•
by
Steve The Pirate
(unregistered)
|
That is an interesting value to initialize your int to |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:31
•
by
Severity One
|
You are obviously unfamiliar with Alizée. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:37
•
by
Tyler Durdin
(unregistered)
|
The first rule of GetStringValue is return "" for (obj == null). The second rule of GetStringValue is return "" for (obj == null)! The third rule of GetStringValue is if !(obj == null) - you HAVE to fight. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:38
•
by
The Mr. T Experience
(unregistered)
|
Do you mean the singer? Why? because you think she's hot? I suppose you also think that Harry potter movies aren't gay because you have a crush on that little girl Emma what's-her-name? |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:39
•
by
PedanticCurmudgeon
|
FTFY |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:39
•
by
C-Octothorpe
|
I tried CTRL-SHIFT-B-ing the text editor, but it didn't report any build errors. I blame Obama, really... |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:43
•
by
Dave
(unregistered)
|
if (obj == null)Clearly this guy is one of those who thought "something isn't working; let me try this". For some reason the technology world (and maybe the rest of the world?) is full of "try this" people who never bother to figure out what's actually wrong. You'll find them on every helpless desk: Did you try rebooting? If you're a "try this" guy, I have only one thing to say to you: Did you try thinking? |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:43
•
by
Matt Westwood
|
Good call. It was a knee-jerk reaction. He's a jerk, I kneed him. |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:47
•
by
C-Octothorpe
|
+1 *added to personal vocabulary* |
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:51
•
by
Jerry
(unregistered)
|
|
If those shagnasty long variable names didn't come from PeopleSoft, they must at least have been autogenerated by the same convert-mainframe-COBOL-directly-to-web-2.0 utility.
|
Re: Useless Functions, Extreme Naming, and More
2011-10-31 12:54
•
by
Bananas
(unregistered)
|
Whoever created this mess fell into the all-too-common trap of using the word "rate" when he clearly meant "interval" instead. If you increase the value of that thing he named "rate" you will decrease the actual rate at which things happen. Does that help? |
| « Prev | Page 1 | Page 2 | Page 3 | Next » |