Applying a bit of XP to hobby projects

Hobby projects, everybody has one or two on the go. They’re fun little side-steps from the mundane routine of developing for a living. These projects usually get a fair bit of thought put into them, but precious little time–an unfortunate side-effect of having a life outside work.

We’re all used to working within limited time-frames, but the limitations are much more noticeable when you only have a few hours on a Sunday afternoon. This time is precious, but unfortunately we often find ourselves spending the time doing much less than we would like. That might be because you’ve hit a design aspect you can’t solve yet, or more often because your time is spent flitting between tasks. This lack of visible progress has a demoralising effect, next time you get some free time you may be less inclined to spend it on your project because you know you’ll not make much headway.

Read more »

Getting with it: Test-Driven Development

Test-driven development is a practice that has started to make some serious headway into the average developer world of .Net. The tools have reached a stage of maturity where they offer solutions to most (if not all) aspects of test-driven development. Alongside the improved tools there has been a dramatic increase in the quantity and quality of articles addressing the needs of new and established test-driven developers. The combined effect of this is of a reduced learning curve for the average developer.

Read more »

Using Internet Explorer's conditional comments for targeted JavaScript

The demise of CSS hacks, something which has been covered elsewhere to no end, definitely a good thing, but not what I’m covering here - not directly anyway. I’ve been wondering if we can take advantage of this new age of “hack segregation”.

The way I see it is we’re already breaking the rule of separation by using conditional comments in the structure, so why don’t we cease this opportunity to save our friends (users of Firefox, Safari, Opera etc…) some bandwidth by providing IE specific JavaScript in the same way too?

Read more »

SQL Server Object Exists Function

Update: Added separate versions for SQL Server 2000 and SQL Server 2005, due to the differences in the system objects tables.It may just be me, but when writing migration/create scripts for use with SQL Server I get quite agitated at having to write an ugly, long-winded, drop statement at the start of every object definition.

The support for dropping objects is one of the few things I would say MySQL has SQL Server over the barrel for.Baring in mind that if you try to drop an object that doesn’t exist, you’ll get an execution error; here’s how to drop a table in MySQL:

DROP TABLE IF EXISTS customers

Here’s how to drop the same table, if you’re using SQL Server:

IF EXISTS(SELECT 1 FROM sys.objects WHERE OBJECT_ID = OBJECT_ID(N'customers') AND type = (N'U'))    DROP TABLE customers
Read more »

JavaScript Console in Safari

Just a quick tip to enable the Debug menu in Safari, the main reason being to get the JavaScript Console (ala Firefox).

Simply close down your open instances of Safari and enter this into the Terminal:

defaults write com.apple.Safari IncludeDebugMenu 1

That’ll enable a new Debug menu next time you start Safari, simple as that. I was on the verge of loading up Firefox on the Mac before I came across this, bad James!

Also, just in-case, running the above again with 0 will turn off the menu.

Read more »