Comment On FAIL FAIL,FAIL FAIL,FAIL FAIL and More

"We're had been using a manufacturer's web service, but started getting errors all of a sudden," wrote Peter Lindgren. "Something has really, really failed." [expand full text]
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:08 • by Bednee (unregistered)
Actually, the way to open a link in a new window makes sense. The reason is that "target" attibute isn't valid in some XHTML doctype (I believe it's Strict, which else right). So in order to keep validity it has to be done this way.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:08 • by the beholder (unregistered)
How the hell someone creates a 83-parameter function and doesn't see anything wrong with that?

One can achieve only so much FAIL, FAIL, FAIL .

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:15 • by QJo
There's a cogent reason for defining SLASH = "/" and PERCENT as "%". They're control characters. When you want to build a string using them, in certain contexts, you don't want to muddy the waters by having to remember to escape them. Often more trouble-free to do it this way.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:15 • by Se (unregistered)
381025 in reply to 381021
Bednee:
Actually, the way to open a link in a new window makes sense. The reason is that "target" attibute isn't valid in some XHTML doctype (I believe it's Strict, which else right). So in order to keep validity it has to be done this way.


Agreed. That one isn't a WTF.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:16 • by QJo
381026 in reply to 381022
the beholder:
How the hell someone creates a 83-parameter function and doesn't see anything wrong with that?

One can achieve only so much FAIL, FAIL, FAIL .


How the hell someone counts the parameters to an 83-parameter function and doesn't see anything wrong with that? Get back to work immediately!

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:18 • by the beholder (unregistered)
true1: twice as false as any plain, regular false booleans out there.

I'll propose John D. to change the code to

bool true1 =true;

bool true12 = true;
.... snip ....
true1 = false;
true1 = false;


for thrice the falseness.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:20 • by anony-mouse (unregistered)
381028 in reply to 381021
Bednee:
Actually, the way to open a link in a new window makes sense. The reason is that "target" attibute isn't valid in some XHTML doctype (I believe it's Strict, which else right). So in order to keep validity it has to be done this way.

Indeed. Remember, blame the developer before being open minded about why they would do something a certain way.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:21 • by My Name (unregistered)
<a href="/the/path/to/the/url"
onclick="window.open(this.getAttribute('href'),'_blank');return false;">
link text
</a>

I don't know more than HTML basics, so I assume there is a way to do this without Javascript? Otherwise, I don't see the wtf.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:21 • by Konrads (unregistered)
The X-Backside-transport FAIL FAIL comes from IBM WebSphere DataPower SOA and it says it when it can't service the request.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:24 • by ¯\(°_o)/¯ I DUNNO LOL (unregistered)
Hmm, that seems to be missing something...
bool filenotfound1 =true;
bool filenotfound12 = true;
.... snip ....
filenotfound1 = false;
filenotfound1 = false;
Much better.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:24 • by operagost
Clearly, the programmer in example 3 had practice for the company softball team on his mind.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:25 • by SergeS (unregistered)
381033 in reply to 381029
My Name:
<a href="/the/path/to/the/url"
onclick="window.open(this.getAttribute('href'),'_blank');return false;">
link text
</a>

I don't know more than HTML basics, so I assume there is a way to do this without Javascript? Otherwise, I don't see the wtf.


Yes, but this is not valid XHTML way

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:30 • by the beholder (unregistered)
381035 in reply to 381027
the beholder:
true1: twice as false as any plain, regular false booleans out there.

I'll propose John D. to change the code to

bool true1 =false;

bool true12 = true;
.... snip ....
true1 = false;
true1 = false;


for thrice the falseness.
FTFM. Stupid work-related hurry...

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:30 • by DaveK
381036 in reply to 381029
My Name:
<a href="/the/path/to/the/url"
onclick="window.open(this.getAttribute('href'),'_blank');return false;">
link text
</a>

I don't know more than HTML basics, so I assume there is a way to do this without Javascript? Otherwise, I don't see the wtf.
Yep. You can just set "_blank" as the target attribute of the a tag, statically, in the HTML code, without using JS at all.

<a href="/the/path/to/the/url" target="_blank"> link text </a>

[Edit:added example]

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:31 • by Anketam
381037 in reply to 381026
QJo:
the beholder:
How the hell someone creates a 83-parameter function and doesn't see anything wrong with that?

One can achieve only so much FAIL, FAIL, FAIL .


How the hell someone counts the parameters to an 83-parameter function and doesn't see anything wrong with that? Get back to work immediately!
What makes you think he manually counted? All you have to do is copy and paste it into the editor of your choosing and get the line number.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:34 • by Darth Paul (unregistered)
Johnny B Guid... tee hee.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:35 • by x (unregistered)
"The comment says it all," wrote Michael.

/**
* Defines the value for none. Default is "none".
*/
public static String NONE = "none";

Say you are dealing with an API like this:
   

bool Framework.Object.SetData(string key, string value);
string Framework.Object.GetData(string key);

You can write code like this:
   

Object o = Framework.FindObject(x);
if (o.GetData("foo") == "bar") { /* do stuff */ }

Or, like this:
   

public static class Keys {
public static readonly string FOO = "foo";
}
public static class Values {
public static readonly string BAR = "bar";
}
Object o = Framework.FindObject(x);
if (o.GetData(Keys.FOO) == Values.BAR) { /* do stuff */ }

There may be any number of reasons why here, the NONE string is not readonly; indeed, the comment about it having a default value implies that it is specifically not intended to be.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:36 • by Stefan (unregistered)
/**
* Defines the value for none. Default is "none".
*/
public static String NONE = "none";

That ain't so bad. Probably just a text when a var. is empty.
although something like String blankText = "none"; or would have been better.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:42 • by Otto (unregistered)
381041 in reply to 381036
The "target" parameter is not valid in XHTML 1.0 Strict, so using it like that would not pass validation.

You have to consider your use-case with HTML, basically. Which makes HTML the real WTF here.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:44 • by Foo Bar (unregistered)
If you read TDWTF via RSS, TRWTF was the bizarre indentation of the various paragraphs in this article.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:47 • by $$ERR:get_name_fail (unregistered)
381043 in reply to 381039
x:
There may be any number of reasons why here, the NONE string is not readonly; indeed, the comment about it having a default value implies that it is specifically not intended to be.

The WTF is not the string not being constant, it's the comment which - while being technically correct - includes no relevant information whatsoever.

Anyone who got beyond the value assignment part of the tutorial understands that the value of NONE is initialized to "none" in this line. Relevant information would be the meaning of the variable in the code below and why it is initialized to "none".

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:50 • by XXXXX (unregistered)
Can someone explain what's wrong with the JS validation?

Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:51 • by Nagesh (unregistered)
381045 in reply to 381040
Stefan:
/**
* Defines the value for none. Default is "none".
*/
public static String NONE = "none";

That ain't so bad. Probably just a text when a var. is empty.
although something like String blankText = "none"; or would have been better.

Ain't problem being veriable storage as Java is not creating new string instances when used insted of constants. Problem is coments redundancies (which some shops are actual requiring). I also try ain't to use redudancy coments instead trying to reword.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:52 • by Nagesh (unregistered)
381046 in reply to 381045
Also, value for NONE ain't being constant.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 09:58 • by Nappy (unregistered)
The HTML 4.0 specification took away the target attribute, but it added another attribute: rel. This attribute is intended to specify the relationship between the document that contains the link, and the target of the link. The specification defines a bunch of standard values for this attribute (e.g. next, previous, chapter, section), most of which have to do with relationships between small sections of a larger document. However, the spec leaves the developer free to use nonstandard values for site-specific purposes.

http://www.sitepoint.com/standards-compliant-world/

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:01 • by $$ERR:get_name_fail (unregistered)
381048 in reply to 381044
XXXXX:
Can someone explain what's wrong with the JS validation?

Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.

The WTFs are:
1. using cryptic variable names t1 - t13
2. copying the values of more verbose variables to them although all that is done with them is read them once.
3. having a variable to store the return value of the function, and then always return immediately after setting it. Instead of "dataok = false; return(dataok);" you could just do "return false;"

Another thing you could nag about is the lack of localization, but this might not be required when the target demographic of the website are only english-speakers.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:04 • by That Guy (unregistered)
381049 in reply to 381044
XXXXX:
Can someone explain what's wrong with the JS validation?


Indeed. The variable names suck, and the inconsistent use of the the return-value flag is sloppy, but those don't make this a WTF.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:06 • by Charles (unregistered)
381050 in reply to 381025
Yup. I've done this before when we're trying to achieve XHTML 1.0 Strict doctype.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:08 • by x (unregistered)
381051 in reply to 381043
$$ERR:get_name_fail:
x:
There may be any number of reasons why here, the NONE string is not readonly; indeed, the comment about it having a default value implies that it is specifically not intended to be.

The WTF is not the string not being constant, it's the comment which - while being technically correct - includes no relevant information whatsoever.

Anyone who got beyond the value assignment part of the tutorial understands that the value of NONE is initialized to "none" in this line. Relevant information would be the meaning of the variable in the code below and why it is initialized to "none".

No relevant info whatsoever? Fast-forward two years when the code looks like this:

/**
* Defines the value for none.
*/
public static String NONE = "nil";

Perhaps there is no further explanation as to the purpose of this string elsewhere in comments or design docs. That would be bad. I see no problem, though, in a) indicating the intention of the variable where it is defined, and b) not documenting the entire system at this particular location.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:12 • by oheso
381052 in reply to 381041
Otto:
The "target" parameter is not valid in XHTML 1.0 Strict, so using it like that would not pass validation.

You have to consider your use-case with HTML, basically. Which makes HTML the real WTF here.


Links which open in new windows are TRWTF.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:14 • by oheso
381053 in reply to 381043
$$ERR:get_name_fail:
... which - while being technically correct - includes no relevant information whatsoever.


Sort of like software documentation in that respect, then.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:17 • by oheso
381054 in reply to 381048
$$ERR:get_name_fail:

3. having a variable to store the return value of the function, and then always return immediately after setting it. Instead of "dataok = false; return(dataok);" you could just do "return false;"


I wondered about that, too, but it's also possible from what we see that dataok is a global variable (well, in which case it's not necessary to return it, unless it's to cancel the event bubbling up).

But yeah, spot-on with the rest of the analysis (and in all likelihood, with this part, too).

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:18 • by dkf
I like how they need a byte to describe the sex of a client. That's very… modern of them…

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:19 • by oheso
381056 in reply to 381050
Charles:
Yup. I've done this before when we're trying to achieve XHTML 1.0 Strict doctype.


And the question is, "Why?"

OK, if you have to do it to satisfy the client, then you gotta do what you gotta do to get paid. But the requirement (opening in a new window, not XTHML compliance) is and will always be TRWTF.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:19 • by TheCPUWizard
I guess GUID from our production db servers are better than local GUID


For Type 1 Guids, there are some valid reasons for wanting all of the Guids from the same source. For Type 3 Guids, the reasons are different, less important, but still exist [however, I would be accused of being pedantic if I pointed out why...<grin>]

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:22 • by oheso
byte ClientSex,


Kinky.

(And only with ClientPermission, please ... )

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:22 • by Ben Jammin (unregistered)
381059 in reply to 381044
XXXXX:
Can someone explain what's wrong with the JS validation?

Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.


It is totally cause he could've put t13 with the rest of the required fields. I mean... WTF...

CAPTCHA: oppeto - You say oppeto, I say oppato

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:22 • by dark Yuris (unregistered)
381060 in reply to 381040
not bad indeed. it's just a workaround of not having language constructs like symbols in ruby.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:27 • by snoofle

public static final String SLASH = "/";
public static final String PERCENT = "%";

I usually name constants for what they do:

private static final String DELIMITER = "%";

This way, if you need to change the value, you don't need to change the variable NAME everywhere.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:31 • by Loren Pechtel
This one is clearly cargo-cult programming:

if ( resData.state() == RESOURCE_STATE_ACTIVE )
{
elapsedTime.setBase( resData.startTime() );
if ( elapsedTime.diff() >= maxDuration )
{
// Do one more validity check, the paranoid programmer knows
// the state may have changed since the last check.
if ( resData.state() == RESOURCE_STATE_ACTIVE )
{
resourceActiveTooLong( resData );
}
}
}

I'm strongly reminded of the test-lock-test pattern you often see with singleton creation.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:41 • by nobulate
Giga B wrote, "it's pretty serious about the number of parameters in functions.":

byte ClientSex,
string ClientFatherName,


I applaud them for acknowledging more than 2 sexes, completely logical in some cultures.

It gets creepy when really personal details about the guarantor gets recorded.

byte? GuarantorSex
string GuarantorFatherName,
string GuarantorBirthPlace,
string GuarantorCityAttendingToReg,
string GuarantorJobActivity,
string GuarantorJobPosition,
string Guarantor*JobCodeWord*,


Seems like provision for secret agencies as well, neat.

Tinfoil hats looking good now, eh?

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:44 • by x (unregistered)
381064 in reply to 381061
snoofle:

public static final String SLASH = "/";
public static final String PERCENT = "%";

I usually name constants for what they do:

private static final String DELIMITER = "%";

This way, if you need to change the value, you don't need to change the variable NAME everywhere.


Akismet won't let me post the code, but you also have the situation where you want to conditionally compile something like a platform-specific path separator.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:44 • by $$ERR:get_name_fail (unregistered)
381066 in reply to 381055
dkf:
I like how they need a byte to describe the sex of a client. That's very… modern of them…

With all the transgenders, pangenders, third-genders and their different flavors fighting for society recognition, a single byte might in fact not be enough to cover all relevant cases.

Maybe a bunch of slider controls would do the trick.

Captcha: genitus. How fitting.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:45 • by emaN ruoY (unregistered)
Object Orientation took a core dump and cried at Giga B's submission

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:48 • by big picture thinker (unregistered)
Public Function Save() As Boolean

Try
SaveMeeting()
Catch ex As Exception
Throw ex
End Try
End Function


BS, this won't even "build". (That's is .NET's equivalent to "compile")

The function doesn't return a value.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:50 • by Medinoc
As a .Net developer, I ABHOR the "throw ex" construct: It strips the exception of its stack trace, making debugging harder.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:52 • by SilentRunner
Bunch of crap.

Each code sample shown here with no explanation is like showing me a picture of an empty chair in front of a computer and then allowing me to guess what is wrong with the picture.

What a damned waste of time.

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 10:58 • by oheso

Throw ex


So much satisfaction in one line of code ... who hasn't wanted to do this at one time or another?

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 11:08 • by Strolskon
381072 in reply to 381048
$$ERR:get_name_fail:
XXXXX:
Can someone explain what's wrong with the JS validation?

Looks like they are doing some crappy validation on the client side before sending it to the server for true validation.

The WTFs are:
1. using cryptic variable names t1 - t13
2. copying the values of more verbose variables to them although all that is done with them is read them once.
3. having a variable to store the return value of the function, and then always return immediately after setting it. Instead of "dataok = false; return(dataok);" you could just do "return false;"

Another thing you could nag about is the lack of localization, but this might not be required when the target demographic of the website are only english-speakers.


Three minor WTFs in one function! That's got to be some kind of record.

TRWTF is using a system that has makes you write the forms in one language AND validate them in another language AND validate them again in another language.

Maybe in a few years web developers will be able to use native HTML5 form validation?

Re: FAIL FAIL,FAIL FAIL,FAIL FAIL and More

2012-05-14 11:21 • by codemonkey73 (unregistered)
381073 in reply to 381041
"target" isn't valid in HTML 4.0 Strict either.
« PrevPage 1 | Page 2 | Page 3 | Page 4Next »

Add Comment