August 2005 - Posts

I recently came across code like this of a collegue:

public object SomeMethod
{
 DataSet ds = DataService.RetrieveData();

 if(ds.Tables[0].Rows.Count > 0)
 {
  ...code...
  return prod; 
 }
 throw new Exception("error message");
}

As you can see, the exception is thrown when the dataset is empty.
What I find wrong with this code is the way the throw almost seems unconditional.

public object SomeMethod
{
 DataSet ds = DataService.RetrieveData();

 if(ds.Tables[0].Rows.Count > 0)
 {
  ...code...
  return prod; 
 }
 else
 { 
  throw new Exception("error message");
 }
}

This two ways of handling this functionality both work, but what do you think/prefer?

So, it's official, men are more intelligent than women...

Research by Manchester University shows there's about a 5 point difference. http://news.bbc.co.uk/1/hi/education/4183166.stm 

But not to worry, my female friends! There's still hope.
Research by (also UK based) universities show that women are attracted by intelligent men, while men tend to be put off by intelligent women.
(http://frontpage.fok.nl/nieuws/49862 sorry, in Dutch)

So, in the end, everything works out for both sides

 

A collegue of mine, Edwin Jongsma, pointed out this article (by Joel Spolsky)

As you know by my previous post I'm always amused by Joel's writing. This one is also very nice (and lengthy)...

If you're a software developer, you should definitely read this!

I really like the way Joel Spolsky writes about stuff in the IT business.

Sometimes his posts are quite lengthy but he always has food for thought, like this one: How Microsoft Lost the API War

Especially his comments on Longhorn are interesting and I must say, I've heard this before...
Maybe he's right? Tell me what you think!