Tuesday, June 30, 2009

Southwest Fox Registration Saver Deadline Coming Up

Southwest Fox, the fantastic US FoxPro developers conference, has a special deal for registration with $125 off the regular $745 price.

Note: The deadline has been extended to July 7th, 2009 so sign up today.

The conference line-up looks amazing this year, just as in past years. One of the tracks that really seems to be fleshing out is the Technology Track, with sessions on Virtual PC, SourceGear Vault, Subversion and more.

Southwest Fox definitely has it all: great speakers, great sessions, great networking - a great experience for developers.

Saturday, June 27, 2009

Death of a legend

While I don't usually use this site for personal thoughts, I do want to take a moment to recognize the death of Michael Jackson, a true legend in pop culture and someone who affected the entire world with his music in a positive way.

While his lifestyle was crushing and troubling, his legacy lives on through his music and his impact on the video generation. Like his music or not, he invented pop culture as it exists today (through video, music and celebrity). I think most of the world today has some memory of him, as I know I do.

Just a thought - his planned comeback tour should continue on - with other musicians (Justin, Usher, Smokey, Paul, his brothers to name a few) taking part in those 50 concert shows, paying tribute to him. The money could go towards the obvious litigation that will be coming.

As the Righteous Brothers sang, "if there's a rock'n'roll heaven," then Michael has just joined one hell of a band.

He will be missed but his music lives on. Rest in peace, Michael Jackson.

Anyways, back to our regularly scheduled development posts.

Wednesday, June 17, 2009

Test Driven SQL Projects

SQL Server Central just posted part 2 of an interesting article on applying the techniques of test-driven development to a SQL project. The author, Andy Leonard, goes from describing basic tests for setting up your databases to writing tests for inserting and updating data.

It's good stuff for a variety of reasons. He noted in the first article that some of the techniques are simply good coding practices (drop and recreate) but by writing them up as test scripts as well as within the SQL itself makes the entire piece part of a regression test and can resolve lots of further problems. He also points out that unit tests mean different things to different people so ensure your definition is the same as others on your team.

I'll be the first to admit that I'm not following the full pattern of writing individual tests out for each of my tables (the firing squad can resume shortly) - but the overall approach that Andy describes is solid and depending on how you code, you might find you are already doing a lot of what he describes.

"What’s really cool about all this is the fact that it’s re-executable. You can run the same script against a new instance of SQL Server where WeatherData has never been deployed, or you can run it where only version 1.0 has been deployed. I like that a lot."

Much of it is obvious to most db developers (before creating a stored proc, check its existence, ensure you have the right database selected, etc) - but there's still a lot of dirty code out there in the while. I *love* re-executable SQL - on my current project, I'm seeing a lot of code that is made to run once, just to clean something up. I keep on sending it back to the developers noting that when we do an interim release, we need to be able to re-run the code as often as it takes until it's ready.

Definitely worth the read.

Wednesday, June 03, 2009

Linux ready for the desktop? Show me productivity first.

ZDNet has an article titled Linux Ready for the Desktop.

While I do enjoy Ubuntu quite a bit (at least on one desktop) and I would never doubt the usefulness of Linux on a wide variety of machines, my concerns over open source systems have become more widespread with issues about forks.

Linux is certainly a different scenario than MySQL but consider this - mySQL has been considered a viable alternative for commercial RDBMS' for how long? It's been around since 1994 but has only really become a force to reckon with in the past 10 years.

Certain incarnations of Linux are certainly ready for the desktop (OpenOffice is arguably a good alternative to MS Office - bloat and all) - but then so are an entirely cloud or web-based OSes.

My #1 concern with any OS that I'm going to place on my desktop is "does it make me more productive?" (an offshoot of that would be "does it make any of my clients more productive?")

I'm a firm believer that people will pay for things that make them more productive. I believe Vista has shown that people are NOT willing to pay for upgrades that don't. The security argument doesn't completely wash with me because too many people gun for Microsoft since it is the leader - no OS is impervious to attack (except the one that isn't connected to anything).

Now I've been playing with the Windows 7 beta and so far, it isn't bad - but it still annoys me a bit more than Windows XP but far less than Vista. I've been living in a Visual Studio 2008 project with third party controls and while some of the results are nice, I still rely on Visual FoxPro to do a great deal of the background work.

On the same project, I work with SQL 2005 but I also have SQL 2008 on my office machines - I can safely say SQL 2008 is far better than SQL 2005 in making me more productive. Yet I still use VFP to write automated SQL scripts - it's simply better at text handling than any other tool.

Some people love the Windows Explorer - others find alternatives. The only real way any new operating system is going to make it is by making people more productive, not by a little but by a lot.

The iPhone isn't a great phone - but it does open up the entire world of smart phones to consumers in a way that Windows Mobile simply hasn't. Both phones have features that the others don't - but cell phones are a consumer product - they rely not just on impression and productivity but also "coolness".

Desktop operating systems do not rely on the coolness factor - they are there to get a job done. I don't want an operating system that simply replaces another - I want one that makes me do more with less.


Monday, June 01, 2009

Refactoring T-SQL

While much has been said about the benefits of refactoring application code (see VFPX Code Analyst), I typically haven't seen a lot of noise about refactoring T-SQL and stored procedure code.

The refactoring features found in SQL Manager tend to be more about refactoring your database design but not about the actual content of the SPs.

It's important to note that if you tend to rely on large stored procedures, then many of the same rules of refactoring apply:

1. Keep it short and sweet.
2. Make it readable.


So when dealing with a particularly unruly stored proc (over 1000 lines), I was quite happy to find Red Gate's SQL Refactor (here's a post from the lead developer).

Some of the features are pretty basic (renaming variables, etc) but the one of great interest was the Encapsulate as a new Stored Proc.

As with a number of tools that are add-ons to other components, its overall usefulness might seem limited if you are building your stored procs either using testing patterns or have good code review sessions - but if you're inheriting or just watching one procedure get too big, it's definitely useful.

What about your SQL applications? How big do you let your stored procedures get?
What tools do you use?