Dec. 26th, 2006

giza: Giza White Mage (Default)
 
http://www.youparklikeanasshole.com/

They have notices which you can download, print out, and place on the windshields of cars that are parked poorly.

I think I just found a way to entertain myself during lunch hour.
giza: Giza White Mage (Default)
A few of the jobs I've worked at over the years have reqired me to maintain code written by those before me. Sure, undocumented code is a pain, but some things end in me shaking my head while muttering "WTF?" to myself over and over.

Here are a few examples:

1) Calling srand() in a for loop. That seeds the random number generator. You don't need to keep reseeding the generator on every iteration of the loop!

2) Writing code like this:

try {
   function_call();
} catch (Exception e) {
   throw (e);
}


Do you not understand how exceptions work? Throwing an exception you just caught is totally redundant!

3) Writing code like this:

if (condition) {
   return (true);
} else {
   return (false);
}

return (false);


The astute programmer will note that the final return statement is never reached. Do you not understand how return statements work? o.O

4) Things like this:

$file = fopen($filename);
$line = fgets($file);


Is it that hard to check the return value of a function? Do you like seeing file permission errors all over the webpage? I don't!

Related reading: The Chronicles of George (aka, The System is "Havening" a Problem!)
Also related: The Daily WTF

Profile

giza: Giza White Mage (Default)
Douglas Muth

April 2012

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
2930     

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags