Saturday, December 24, 2011

Try.Catch.Crap! Getting a string safely without repeating yourself

One thing that comes up a lot is when/where to write try/catch blocks.

When trying to follow DRY, it's often frustrating when you need exactly the same value but in scenario 1 you want the getter to throw if the value is not available, but in scenario 2 you want a default value if the value is not available. I had just such a situation yesterday.

Are Your Activities Making You Smart in a Google World?

KQED recently did a show: Is Google Making Us Stupid? This interview got me thinking... Whether you agree or disagree, there is little doubt that heavy use of the internet changes how you think. You can feel it happening.

Cost of GUIDs as PK...greatly exaggerated

The cost of using GUIDs as a primary key in your DB can be quite high if your DB grows to tens of millions of records, especially if you use random GUIDs. However, the dangers of these practices have been greatly exaggerated and fear mongering from some respected DBAs has caused concern among some developers. So much so that many would NEVER use a GUID as a primary key.

Below, you’ll see that, if use properly, the performance difference between integers and GUIDCOMBs is less than 10%.