Article 6BMBA CodeSOD: Exceptional Assignment

CodeSOD: Exceptional Assignment

by
Remy Porter
from The Daily WTF on (#6BMBA)

Ellen sends us a very simple WTF today, that she found in production code.

bool condition;try{ condition = true;}catch{ condition = false;}

It's true, there isn't much to say about this exceptional code block. But if assigning a boolean to a boolean variable ever fails, we're prepared to handle it.

buildmaster-icon.png [Advertisement] Utilize BuildMaster to release your software with confidence, at the pace your business demands. Download today!
External Content
Source RSS or Atom Feed
Feed Location http://syndication.thedailywtf.com/TheDailyWtf
Feed Title The Daily WTF
Feed Link http://thedailywtf.com/
Reply 0 comments