Its time for a new category here on my blog... I've been working through a good bit of older code at work and trying to update it to something like modern developer standards. Part of the fun of this has been finding weird, pointless language constructs. Check out this C# example:
Neat! This developer was able to use 4 lines of code to do one line of code:
Do you have any good examples of code that just shouldn't have been?
The EnableEditButton() function from the last example is worth a look too...
if (Value == false)
buttonAdd.Disabled = true;
buttonDelete.Disabled = true;
buttonAdd.Disabled = false;
buttonDelete.Disabled = false;
Could be wrapped up as:
buttonAdd.Disabled = buttonDelete.Disabled = !Value;