An open space, a few programmers, everyone doing his stuff, silently typing, no one talking.
From time to time, one of the typists bursts into an incredible laugh.
It is not because he is surfing funny web sites.
There is so much fun in our codebase that no one needs to go far away in search of a good laugh.
We all know he just found some new obsucre funny piece of code in our wonderful code base and gather at his desk to have a little laugh with him:
public void Load() {
Cursor c = Cursor.Current;
try {
Cursor.Current = Cursors.WaitCursor;
_load();
}
catch (EnterpriseException xex) {
this._log.WriteLine(Category.Error, eex.ToString());
}
catch (ProgramException piex) {
this._log.WriteLine(Category.Error, pex.ToString());
}
catch (Exception ex) {
this._log.WriteLine(Category.Error, ex.ToString());
}
finally {
Cursor.Current = c;
}
}
Then everything comes back to normal, and in a few seconds, the same guy bursts into an incredible laugh again.
He just scrolled to method just above the famous Load:
public void Save() {
Cursor c = Cursor.Current;
try {
Cursor.Current = Cursors.WaitCursor;
_save();
}
catch (EnterpriseException xex) {
this._log.WriteLine(Category.Error, eex.ToString());
}
catch (ProgramException piex) {
this._log.WriteLine(Category.Error, pex.ToString());
}
catch (Exception ex) {
this._log.WriteLine(Category.Error, ex.ToString());
}
finally {
Cursor.Current = c;
}
}
And in no more than 30 seconds later, no one is surprised to find the method just above the first one:
public void Add(object[] items) {
Cursor c = Cursor.Current;
try {
Cursor.Current = Cursors.WaitCursor;
_add(items);
}
catch (EnterpriseException xex) {
this._log.WriteLine(Category.Error, eex.ToString());
}
catch (ProgramException piex) {
this._log.WriteLine(Category.Error, pex.ToString());
}
catch (Exception ex) {
this._log.WriteLine(Category.Error, ex.ToString());
}
finally {
Cursor.Current = c;
}
}
And this is not some amateurs' job. The guys who wrote this code are very serious about catching all their exceptions.