Technology
Another MacBook Pro Owner
I picked up my Intel Mac last week. It will soon replace the Mac mini I bought in February 2005, and the Dell PC I bought a couple of years before that. It’s the first laptop I’ve had that wasn’t issued to me by an employer. So far, I think I’m going to be very happy with it.
The first impromptu performance test was this: can the MacBook Pro handle simultaneous installations of Windows XP Pro (in Parallels for Mac) and World of Warcraft (direct to the Mac)? The answer turned out to be yes, even with over a gigabyte worth of WoW upgrades (and nearly 80 patches to Windows XP Pro, not including SP2).
The next items on the the to-do list for setting it up are these:
- Install most of the stuff described here
- Transfer data from the Mac mini
- Install Microsoft Office 2003 on the Windows XP virtual machine
GUID vs. Identity Column for Primary Keys
From the time I started using databases (Sybase 10, Microsoft SQL Server 6.5), I’d always used identity columns for primary keys in tables. So when I came to my current employer and saw GUIDs all over the place, I wondered if that wasn’t overkill.
I did a bit of searching on the issues, and came up with these links:
- Primary Keys: IDs versus GUIDs (Jeff Atwood of Coding Horror)
- The Cost of GUIDs as Primary Keys
- Identity vs. Uniqueidentifier (Joe Celko discussion thread post)
- What Should I Choose for My Primary Key
Working with virtual machines
A few weeks ago, my employer updated the RAM on a bunch of our machines to 2GB. The reasons was so we could do our development using virtual machines. I haven’t done development work this way before (probably because I never worked anywhere before that gave you enough RAM).
So far, it’s only been a bit different than working with everything directly installed. Visual Studio 2005 is a bit slower (of course). The other minor inconvenience is that I can’t add new users to TFS from my virtual machine. I suspect this has more to do with it being configured incorrectly than with the virtual machine not being part of the domain. Access to network shares is virtually unchanged, since you can map network drives and connect using a different user name.
ApexSQL Diff
I first heard about this tool from my friend Greg at work. I’ve been using it the past couple of weeks now as a free trial and it’s awesome. Compare the structure and/or data of any two databases and synchronize them with just a few mouse clicks.
This tool is perfect for deploying database changes to different environments. It’s already saved me hours of time compared to what I would have spent trying to do things manually. I’ll definitely be buying a copy for myself. Every DBA should own a copy.
New Monitor (At Last)
I’ve been using a 19" Hitachi CM751 monitor for a long time–until today. FedEx delivered a refurbished 24" widescreen from Dell this afternoon. Even at 1680x1050 (I’m still plugged into a KVM switch that doesn’t have a DVI port), it seems enormous. I should have gotten one of these much earlier–it looks great.
Visual Studio 2005 Default Browser Changes
I’m a big fan of Firefox. So it’s the default browser on every machine I have access to. Unfortunately, Visual Studio 2005 didn’t continue using IE as the default like Visual Studio 2003 did. Even changing the default browser back to IE (yuck) didn’t fix the problem. This morning, I finally googled for a fix.
The steps are these:
- Open any web project.
- Right-click on any aspx page.
- Choose "Browse with ..."
- Click on Microsoft Internet Explorer
- Press the "Set as Default" button
Sandcastle Rant
I came across this excellent post on the problems with Sandcastle, the Microsoft offering for generating help documentation for .NET 2.0 assemblies. In addition to pointing out the problems with Sandcastle, the author (Grant Drake) brings us up to date on the status of other successors to NDoc. As someone who used NDoc 1.3 a lot on projects in the last couple of years, I was very disappointed that the author decided to discontinue work on NDoc 2 (especially since we have mailbombers to thank for the loss).
More on VSI files
A bit of “googling” turned up these links:
- An MSDN entry on the subject
- This link to a Power Toy for automating the creation of VSI files
Visual Studio Templates for Test-driven Development
I came across this blog post earlier today via Mike Gunderloy’s Larkware.com. One of the comments requested .VSI files (the templates are for NUnit and MbUnit and are made available as zip files). That probably would be a nicer way to package this. Even without it, I’m glad to see anything that encourages test-driven development. I’ll definitely use this with my development team soon. I should probably learn how to create VSIs anyway.
India Skills Gap
I came across this article in one of the e-mail newsletters I subscribe to. It’s highly relevant to my current role because we use a lot of offshore staff for our work through companies like Tata Consultancy Services (TCS).
The rise in salaries and the springing up of private schools for training people in IT is just what basic economic theory would predict. The quality concerns are predictable as well. Before I joined APS, I asked some consulting colleagues how they would rate the various Indian IT firms. They had strong opinions on which firms were best. A lot depended on where they recruited and how experienced their hires typically were.
One area the post didn’t address that is quite important is turnover. Because salaries in India are going up, that makes it challenging for firms to retain talent for any length of time. This can certainly impact quality for companies like mine that use one or two offshore firms exclusive because we just don’t know who they’re backfilling with when they lose talent to other companies.
It’s certainly possible that India could start losing IT work to China. But I suspect that eastern Europe and some of the former Soviet republics are just as likely to get some of that work. Philip G. Armour’s column in the latest issue of Communications of the ACM talks about a technology firm in the midwest that’s been quite successful with an offshore team in the Ukraine.
Visual SourceSafe Tidbit
I administer my employer’s VSS and Team Foundation Server (TFS) instances as part of my job. As a first-time administrator of these sorts of systems, there’s plenty I’m still learning. Today I found out that moving folders doesn’t work unless the user trying to execute the move has “Destroy” permissions.
The SHAPE command is the bane of my existence
I inherited some classic ASP code not long ago that needed some enhancement. The look-and-feel of the site is pretty nice, but under the covers there’s tons of the inline SQL I hate so much. But worse than that is the previous developer’s use of the SHAPE command. I’d never used it, even when I last wrote classic ASP with my own hands (around 2003). Once this project is over, I hope never to see it or use it again. I’m really struggling to understand how it works (and why things were done this way). I’m hoping this article will help me figure it out. I’m grateful that someone took the time to actually develop a formal grammar for this command. It reminds me a lot of the BNF notation we learned as 1st year computer science majors in college.
More on databases and business logic
This particular entry in the “forever war” of whether to use object-relational mapping or stored procedures does a better job than most in these ways:
- It changes the argument from "either-or" to a situational one.
- It broadens the scope of database objects in the discussion beyond stored procedures to include functions, triggers, views, constraints, and referential integrity.
- It rates the suitability of each database object to a particular task.
Source Code Control
I came across this post from Joel Spolsky last week (though I’m just now getting around to blogging about it). We’re using Team Foundation Server for source code control at work, and we’ve managed to have the problems of check-ins breaking the build and too few check-ins to have a good delta of changes at the same time. While the applications we build at APS Healthcare aren’t the size of an operating system as far as lines of code, the branching-and-merging idea Spolsky describes would probably be useful to us.
Working with IT agencies
I have to deal with IT agencies a lot more now as a software development manager than I ever did in previous roles. So coming across a blog post titled “IT Agencies and the Devil” was pretty funny. If starting an IT agency is as simple as the author suggests, it certain explains why there seem to be so many of them.
So far, I can single out one such agency for providing people that are consistently high-quality–Software Consortium. The guys they’ve sent to work on the projects I’m responsible for have all turned out excellent code and been very good about knowledge-sharing.
NDbUnit
I’ve been a big fan of test-driven development (and unit testing) since I first learned about it a few years ago. It wasn’t until this month that I learned about NDbUnit. This little library is a great value-add for unit tests that involve databases. The creation of test data is tedious if done manually (NDbUnit uses XML for data files), but that’s the only real drawback I’ve found so far in my limited experience with it. It plays very nicely with NUnit, MbUnit, and TestDriven.NET. You can get binaries and source code for NDbUnit from Quality Labs. I also put together a (very) small sample project with Visual Studio 2005 that you can try out.
Home computer backups
Some friends of mine in California have been discussing backup strategies over the past few days. They came across a post by Jeremy Zawodny on using Amazon S3 in addition to his existing backup strategies.
I’m still only using an external hard drive for my backups. I don’t backup my machines regularly enough either. Before Seagate bought them (and before I joined the cult of the Mac), I had a lot of interest in a Mirra Personal Server. At the time it was Windows-only, but now it supports Mac OS X as well. Recently, I started using Deja Vu for backing up the Mac mini. So far, it’s been completely painless.
Continuous Integration
The practice is well-defined in a couple of articles on Wikipedia and on Martin Fowler’s website. But as long as I’ve been reading about this best practice, I’ve never seen it implemented at any of my past jobs (or my current one for that matter). Fortunately, one of the consultants I’m currently working with not only has it implemented, but has the necessary software and test projects on a USB key that he carries with him from job-to-job.
Before I demonstrate it to the broader software team as a practice, I’m trying to get it working on my own machine. Because he uses MbUnit instead of NUnit as part of his implementation, it took me a little longer to get the second of his six test projects working. A little googling for Nant and MbUnit yielded an article that listed 5 files to be copied to the bin directory of Nant. Once I did that, the second test project worked fine.
Strangely, I only saw 4 of the 5 files in this list:
- MbUnit.Core.dll
- MbUnit.Framework.dll
- MbUnit.Tasks.dll
- Quickgraph.dll
- QuickGraph.Algorithms.dll
Why Unit Test
I came across a great post on unit testing today that provided not just why to unit test, but what to unit test. Differentiating software into “infrastructure” and “end user application” really highlights what sort of code will benefit the most from the approach. Another really useful bit of this article talks about turning bug reports into unit tests. It’s a very smart idea that I’ll try to use on my own code whenever it’s appropriate.
MyGeneration and Gentle.NET
After last week’s post about the stored procs vs. ad-hoc SQL debate, I decided I’d take a look at MyGeneration and Gentle.NET if I could think of the right project. I decided to start with a simple contact form.
Anytime a form has dropdowns, I try to use database tables to populate them. So I started by copying data for the dropdowns from an existing database to a new one for the project. Once I created a business logic assembly for the new classes to belong to, I fired up MyGeneration and ran the Gentle.NET business entity template. Creating the classes was very easy. the real challenge turned out to be referring to the right Gentle assemblies in my projects. Because I’d included references to Gentle.Common, Gentle.Framework, Gentle.Provider.SQLServer and log4net in the business logic assembly, I thought that was all I needed to do. But the web project wouldn’t compile. In order to get the page working, I had to add Gentle.Common and Gentle.Framework references to web project.
Once I sorted out my reference issues (and added a Gentle.config file), finishing the contact form went very quickly. I developed this bit of code for loading any dropdown list:
private void LoadDropDown(ref DropDownList ddl, IList dropDownItems, string textField, string valueField) { ddl.DataSource = dropDownItems; ddl.DataTextField = textField; ddl.DataValueField = valueField; ddl.DataBind(); }
Here’s how it’s called:
if (!Page.IsPostBack) { this.LoadDropDown(ref ContactTypeList,BLL.ContactType.ListAll(),“Name”,“ContactTypeId”); this.LoadDropDown(ref SubjectList,BLL.InformationType.ListAll(),“Name”,“InformationTypeId”); this.LoadDropDown(ref OrgTypeList,BLL.Audience.ListAll(),“Name”,“AudienceId”); }