Saw the title. Immediately thought of something I saw today at work. Not too different from yours. 'if ('True' == 'True')'. I should note that this is javascript generated by a template file.
I've actually used 1==2 and 1==1 to basically comment sections out or create an infinite while loop. Only really useful in C-style languages
Dumb mistakes I've seen include commented out error checking because of a reversed greater than sign and a SQL query that deletes the whole table before rebuilding the entire thing every day
I think it is bad practice at least then, if not explicitly bad code, because it's needlessly overcomplicated. Why use the end tag when you're not switching contexts between php and html? After this line there's just another open tag and more code... it's a pointless way of writing php that makes it aggravating to read and edit.
Take a minute look at that and tell me what the keys stand for. When you figure it out you'll realize why this is the worst piece of code you've ever seen.
19 comments
[ 3.8 ms ] story [ 61.1 ms ] threadif (obj instanceof java.lang.Object)
This is (was in Sun's time) an actual possible certification question and you are wrong, this CAN return false:
Dumb mistakes I've seen include commented out error checking because of a reversed greater than sign and a SQL query that deletes the whole table before rebuilding the entire thing every day
Contradiction.
I think it is bad practice at least then, if not explicitly bad code, because it's needlessly overcomplicated. Why use the end tag when you're not switching contexts between php and html? After this line there's just another open tag and more code... it's a pointless way of writing php that makes it aggravating to read and edit.
Each line of HTML is generated like that :
$html.='<html>';
$html.='<body>';
$html.='The content';
$html.='</body>';
$html.='</html>';
The dev used this in every file, each file contain thousands of lines like that. Worst project i have ever seen, and i must work alone on it. FML.
The code was really awful, and that part hurt my eyes:
/* commented out code. <--- Yep. That was the actual comment.
At least (s)he knew what a block comment was.if (failed) { return SUCCESS; }
if( 1 == 1 ) cout << "it's true" << endl; else cout << "false" << endl;
Haha, 1==1