Code I Found
- June 15, 2010 4:24 PM
- Code I Found, C#
- Comments (3)
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:
EnableEditButtons(true);
else
EnableEditButtons(false);
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?
Update!
The EnableEditButton() function from the last example is worth a look too...
{
if (Value == false)
{
buttonAdd.Disabled = true;
buttonDelete.Disabled = true;
}
else
{
buttonAdd.Disabled = false;
buttonDelete.Disabled = false;
}
}
Could be wrapped up as:
{
buttonAdd.Disabled = buttonDelete.Disabled = !Value;
}
Print
Send
Digg It!
Read More
I've been curious for a while about techniques for font replacement on the web. We've probably all heard about the idea of embedding fonts, but looking around at the standards right now, it doesn't sound like any one browser has things right, so I decided to explore a third-party option. Read more to learn about the basics of Cufon, an easy to use font "embedding" system.

