More Ways to Avoid the Second System Effect

Dare Obasanjo had an interesting post yesterday on the Second System Effect in software development. For those who are unaware, the second system effect is a term first coined by Frederick Brooks in The Mythical Man Month. It deals with (in general) the idea that the second system designed/implemented by anyone is typically over-architected, with more bells and whistles added then need be.

Dare goes on to describe a number of common factors that keep systems from falling into this trap. Factors that my experience do contribute greatly to the success of a second version. I do have a couple of factors to add.

Only One Driver

There is a fundamental clash between marketing and developers when it comes to the priority of items added to a product. Marketing is looking for features that will help to drive sales. Developers are looking for features that will improve the architecture, stabilize the product, ease any future enhancements and simply be cool to implement. Frequently, these two groups will not agree 100% at the features which should be in the next release.

Successful projects have a single driver. That is, there is one person who is responsible for determine which features do and don't make the cut. They will listen to both sides of the argument and make a decision, with their ultimate responsibility being to drive the successful shipping of the release. It doesn't matter which discipline the person comes from, although it helps if the driver has the respect of both groups). The important element is to have someone who is making the decision and ensuring that the process doesn't become a continual stream of requests for new features.

Rewriting is not Right

The title should probably read "Rewriting is not Right unless you have extraordinary unit test coverage...and probably not even then", but that wasn't catchy enough.

After you come up for air at the end of a project, it is usual to have some sort of post mortem. Even the name indicates how developers look at this part of the software development process. It is not in our nature (generally speaking) to sit back and admire the good things that were accomplished. Instead, we concentrate on the warts of the system. How many times have you said, immediately after completing a task, that you wished you could rewrite it from scratch?  Take solace that you're not alone in that feeling...it is quite common among your brethren.

The problem is that the feeling to rewrite needs to be resisted. There is, whether you realize it or not, more invested in the development of a particular feature than you might expect. There is more than the code that implements the feature set that is visible. There are also all of the bug fixes associated with the application. The one or two lines of code that were necessary to make the system load the poorly-formatted file that arrives monthly from your biggest client. The use of a semaphore to ensure that a timing problem was corrected. All of those little things that had to be done to take the first pass of code and make it ready for use in the real world.

When you're thinking about rewriting, your mind is focused on reworking the architecture. It is not thinking about the many hours of effort that went into identifying, replicating and correcting the bugs. We know that it's easier to write new code than to read old code, but we don't consider all of the the knowledge embedded in the old code. While throwing out old code is sometimes useful, we tend to fall back on that choice too quickly, believing that 'new' is faster than spending the time to understand the impact of enhancements and changes. If you have a set of unit tests that covers the vast majority of functionality, then you might be able to make a case. But if you don't, then rewriting part of your system should be the last choice, not the first one.

SQL CLR Configuration - A Head Slapping Moment

This post is basically a reminder to a future me. The client I'm working with right now (basically an ISV) is using SQL Express as part of their project. And included in their database are a number of CLR stored procedures. In other words, the stored procedures are written in C#. While a little unusual, this is not particularly extraordinary.

The problem arose as I deployed my application from the build server to a freshly installed machine by hand. Moving the binaries was simple (a file copy from a shared directory). Moving the database was nothing more than a backup and restore. But when I ran the application, things didn't work.

It turns out that I had forgotten an important point, that being that the database setting that enabled the CLR would be 'backedup and restored' along with the database. Given that CLR functionality is turned on using sp_configure (sp_configure 'clr Enabled' to be precise), there was no reason for me to make such an assumption. But I did and the result was a moderate debugging session spent trying to figure out why I was stupid...er...forgetful.

Anyway, the point is that not every setting that a database depends on is backed up with the database. Some are associated with SQL Server itself and are therefore not backed up at all. I knew that, but sometimes I forget. :)

A New Recruiting Drive

ObjectSharp has been growing quite steadily for the past little while. But winning a couple of recent contracts have begun to strain our seemingly unending supply of high-end talent. For this reason (and to get some fresh blood and ideas into the company), we are now actively searching for associates. If you're immediately available, we do have a project that could use your skill set (assuming that your skill set includes C#, Windows/Web Forms and SQL Server). But if you're just interested in learning what ObjectSharp has to offer, I'd be happy to answer any questions. Or you can contact (or forward a resume to) our fantastic Service Manager, Gisele Bourque.

In a few sentences, working with ObjectSharp is a great opportunity to work with some of the top minds in the .NET world using technologies and techniques that are at the forefront of software development. The people are great. The projects are usually quite interesting. And, on top of all of that, you get paid. :) If you'd like the chance to stretch your development wings, it's probably worth having a conversation with us, one way or the other.

ORA-01008 Not All Variables Bound error

I have recently had the opportunity to work (once again) with Oracle. Specifically, I had to create a mechanism that would, based on configurable settings, update either a SQL Server or an Oracle database. In and of itself, this is not particularly challenging. Not since ADO.NET implemented a provider model using the Db... classes that are part of System.Data. The provider name can be used to generate the appropriate concrete instance of the DbConnection class and away you go.

While testing out this capability, I ran into this error when the target data source was Oracle. One would think (and I certainly did) was that I had missed out assigning one of the in-line parameters. The text associated with the error certainly gave that impression. And I was, after all, building the SQL statement on the fly. A bug in my logic could have placed a parameter into the SQL and not created a corresponding DbParameter.

But that was not the case.

Instead, it was that the value of one of my parameters (a string, as it turned out) was null. Not String.Empty, but null. And when you assign a null value to the parameter, it's as if you didn't bind anything to the parameter, the result being that when executing the query, a nice ORA-01008 exception is thrown. The correct way to do the assignment is to set the parameter value to System.DbNull value instead. It would appear that the SQL Server data provider doesn't have this issue, in that the problem only appeared against an Oracle data source. Not a particularly vexing problem, but still it's something to be aware of.

And a couple of years had passed since my last Oracle post ;)

The Cost of Migrating from VB6

Recently, a question regarding the cost associated with migrating from VB6 to VB.NET was asked by one of our clients. Since that is a question whose answer has a broader appeal than just to the asker, I thought I would replicate my response here.

It should be stated up front, however, that I don't normally recommend a migration from VB6 to .NET. This isn't to say that there aren't ways to benefit from the move. It's just that a straight migration typically won't see any of those benefits. Re-architecting an application is generally the only way to get those improvements and a straight migration doesn't accomplish this. And if you already have a working VB6 application, there is little to be gained by creating a VB.NET application that does exactly the same thing.

Keep in mind that I said "little", not "nothing". While the benefits are greater for redesigning, there are still times where a migration is the right choice. Which is the reason why the question of cost does need to be addressed.

There are a number of factors that come into play when trying to determine the cost of just migrating a VB6 application to VB.NET. Let me provide an admittedly incomplete list.

Code Migration

Naturally, the first thing to consider is moving the code from VB6 to .NET. Where there are migration wizards that are available, both from Microsoft and third parties, it is important to realize that there is no way to simply 'wizard' a migration. While the syntax between VB6 and VB.NET are similar, there are many concepts that are different. And no wizard will take a VB6 application and create a VB.NET application that is designed in the most effective manner for .NET. So while you can get an application to be compilable quite quickly, it won't be taking advantage of many of the features of .NET that can improve developer productivity. This is one of the reasons that many companies consider re-writing VB6 applications instead of just migrating them.

That having been said, it is certainly faster to migrate an application than it is to rewrite. An average developer can produce 500-1000 lines of tested and deployable code in a month. However, that same developer can migrate 35,000 to 40,000 lines of code a month. So to calculate raw cost per line of a migration, figure out how much you pay an average developer in a month and divide by 35,000.

Developer Training

Of course, migrating the code is only part of the associated cost. Developers have to be retrained to use VB.NET. A typical VB6 developer will take about six months to regain the productivity level in VB.NET that they had in VB6. A junior developer might take 8 months, while a senior developer will take around 4 months.

Part of the process of getting people up to speed will be training. Depending on the technologies that are being used, anywhere from 10-20 days of in-class training will be needed. A typical breakdown of the topics covered would be 3-8 days of .NET Framework training, 3-5 days of ASP.NET development, 1-2 days of testing. 4-5 days of advanced programming concepts (WCF, Sharepoint, WPF, etc).

While this might seem like an expensive process, there are hidden costs and lost productivity associated with trying to get developers up to speed 'on the cheap'. There is too much in .NET for a single class to provide all of the necessary information in sufficient depth to be able to use it effectively. The problem is that some organizations (and some developers) will pretend that a 5 day course on .NET is good enough. The developer will end up spending the next 12 months looking up how to do the common tasks that weren't covered in the 5 days and will end up making design decisions that, had they the correct knowledge at the time, would not be made. Both company and developer can spend years trying to correct the bad choices made through inexperience.

Preparing the VB6 Application

There are a number of common issues that arise during the migration process, issues that can't be addressed by a wizard. These issues generate the large majority of problems that are found when migrating and include such items as

  • The default property is no longer used
  • The property/method is not found in VB.NET
  • The property/method is found, but has a slightly different behavior
  • COM functionality has changed

If these issues are addressed before the migration (that is, in the VB6 application), it can help speed up the migration process. Each of these issues actually results in a cascade of problems (on the order of 5 VB.NET problems for each instance of a VB6 problem) in the migrated application, so it is worthwhile to spend some time 'fixing' the VB6 application in order to get it ready for migration.

While there are other considerations involved (is the new application to be web-enabled? is there integration with other legacy applications?, etc.), these items are the largest sources of cost associated with migrating from VB6 to .NET.

Aspiring Architect - Web cast series

With all this heat, I almost wrote "perspiring". Why not beat the heat, and stay cool inside while watching these web casts from MS Canada targeting aspiring architects. With the predicted shortage in IT in the upcoming years, we're sure to see an influx of junior resources into our industry. This is a good opportunity for developers to transition into architecture roles to leverage their existing skill set.

The Aspiring Architect Series 2008 builds on last year’s content and covers a number of topics that are important for architects to understand. So it would be a great idea to watch last year's recordings if you haven't already. Links are available here:  http://blogs.msdn.com/mohammadakif/archive/tags/Aspiring+Architects/default.aspx .

Upcoming sessions are as follows:

June 16th, 2008 – 12:00 p.m. to 1:00 p.m. – Introduction to the aspiring architect Web Cast series

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380836&Culture=en-CA

June 17th, 2008 – 12:00 p.m. to 1:00 p.m. – Services Oriented Architecture and Enterprise Service Bus – Beyond the hype

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380838&Culture=en-CA

June 18th, 2008 – 12:00 p.m. to 1:00 p.m. – TOGAF and Zachman, a real-world perspective

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380840&Culture=en-CA

June 19th, 2008 – 12:00 p.m. to 1:00 p.m. – Services Oriented Architecture (Web Cast in French)

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380842&Culture=en-CA

June 20th, 2008 – 12:00 p.m. to 1:00 p.m. – Interoperability (Web Cast in French)

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380844&Culture=fr-CA

June 23rd , 2008 – 12:00 p.m. to 1:00 p.m. – Realizing dynamic systems

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380846&Culture=en-CA

June 24th, 2008 – 12:00 p.m. to 1:00 p.m. – Web 2.0, beyond the hype

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380848&Culture=en-CA

June 25th, 2008 – 12:00 p.m. to 1:00 p.m. – Architecting for the user experience

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380850&Culture=en-CA

June 26th, 2008 – 12:00 p.m. to 1:00 p.m. – Conclusion and next steps

http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032380852&Culture=en-CA

Follow up on Entity Framework talk at Tech Ed 2008

Last week at TechEd I gave a talk about building data access layers with the Entity Framework. I covered various approaches from not having a data access layer at all, to fully encapsulation of the entity framework - and some hybrid approaches along the way.

I gave the first instance of this on Tuesday and then a repeat on Thursday.

To those who saw the first instance of this on Tuesday....

you unfortunately got an abbreviated and disjointed version for which I apologize. After I queued up my deck about 15 minutes prior to the talk I left the room for a minute while people filed in and while I was out, one of the event staff shutdown my deck and restarted it running from a different folder on the recording machine and didn't tell me. I was about 1/3rd into my presentation when I realized that I had the wrong version of the deck. At the time, I had no idea why this version of the deck was running so I wasn't going to fumble around looking for the correct one. Given a change in the order of things - I'm not sure if changing decks at that point would have made things better or worst. I still had no idea why this had happened when I gave the talk again on Thursday but when the same thing almost happened again - this time I caught the event staff shutting down my deck and restarting it again (from an older copy). Bottom line, sorry to those folks who saw the earlier version.

The complete deck and demo project is attached. It is a branch of the sample that is part of the Entity Framework Hands on Lab that was available at the conference and which is included in the .NET 3.5 Enhancements (aka SP1) training kit. You can will need the database for that project which is not included in my down.

Download the training kit here.

 

Live vs. Google: My Personal Verdict

About a month ago, Live.com released an update to their search engine and I took it upon myself to write down my observations of Live as compared to Google. Although the features seemed to be a pretty good leap in many areas, I concluded that the only way to see which one was better was to change my default engine to Live.com for a week or two and give it a try.

Well, it's been a month now and Live.com is still my search engine. It's not like I didn't stop using Google however. I would say that perhaps 10% or less of the time, I felt frustrated by not finding what I was looking for on Live.com and cross-searched Google.com. Of those cases, I would say only half of the time, I found something useful on Google.com that wasn't found on Live.com. These aren't hard numbers, just an anecdotal feel of my experience. When Google.com was my default search engine, my failed searches were likely in the same order as was Live.com's ability to result in something useful where Google.com did not.

So the verdict for me is that in the area of core test searches, the differences were negligible. At no time did I feel that live.com's performance was slower and I always found the image, video & map search to be superior in Live.com. These features alone for me are reason enough to leave Live.com as my default for the time being.

ObjectSharp is going to experiment with some Live.com ads. I'm not expecting any kind of serious traffic to come through ads on Live.com so this is mostly a research project to get familiar with their ad engine.

Essential MS Subscription for Mac-aphile Designers

Are you a design & mac user in a Windows Development Shop? Are they eyeing your Mac and measuring your desk to outfit you with a new PC? Over your cold dead corpse I bet. No worries. You owe it to yourself to check out the Microsoft Expression Professional Subscription.  Yeah, you could run Bootcamp but then you'd loose the OS X & Quicksilver goodness while you paid the bills.

This annual subscription's most important piece of software isn't made by MS: Parallels Desktop for Mac. Parallels will let you run Windows Vista or Windows XP (also included with the subscription) without leaving OS X - better yet with Expose, your desktop will be unified. And with the SmartSelect feature, you'll be opening Mac or Windows files in the OS of your choice automatically. Edit XAML files in Expression Blend (also include) in Windows, but open JPEG's in Photoshop in OS X - regardless from which OS you launched the file from. Very cool.

Here's the complete list of included software

                • Expression® Studio
                  Which includes Expression Web for aspx/css/html stuff, Blend for WPF/Silverlight/XAML stuff,  Expression Design for illustrations & graphics, Expression Encoder for media encoding, and Expression Media for asset management.
                • Visual Studio® Standard
                  Just in case the .NET guys make you check stuff into source control.
                • Office Standard
                • Office Visio® Professional
                  For those workflow diagrams and ugly mock ups that the dev guys send you.
                • Windows® XP
                • Windows Vista® Business Edition
                • Virtual PC
                • Parallels Desktop for Mac

And just to make things even easier, they've already included some pre-configured virtualized servers in the box as well - that will save you some time. Current pricing is about $1000 USD for the first year. This won't be available for a few weeks, but visit here to learn more.

And if you're trying to learn more about WPF and Silverlight, check out our new Windows Presentation Foundation (WPF) for Developers & Designers course. Rob Burke, our User Experience (UX) practice lead talks more about this course here. And finally, check out Rob Windsor's post on our Summer Seat Sale to learn how to save up to $500 on our training this summer.

DevTeach Toronto - in the bag - see you next year...

Well it's just 1 week since DevTeach came to Toronto for the first time. What a great conference and it was my pleasure to be involved as a speaker, track-chair and attendee. The conference organizer Jean-Rene Roy just sent me a note with some of the comments from the overall evaluations. If you didn't attend this year, here's some reasons why you may want to next year:

Great conference! I especially enjoyed the up and personal nature of the conference. I was able to talk with the presenters. I spent most of my time at the agile track. Having topics that are rarely dealt with at user groups was a bonus. I enjoyed all the sessions I attended. The venue was great and the attention to little details, e.g., afternoon ice cream was appreciated.

Jean-René, thank you SO MUCH for bringing DevTeach to Toronto. It was fantastic and I will go again. Your tech chairs did a great job choosing sessions for each track. While I especially enjoyed the Agile sessions, I attended something from each track and the variety was good.

An outstanding conference! All the speakers I saw were terrific — affable, down-to-earth, talented, incredibly knowledgeable. The sessions were entertaining as well as in-depth and honest — no BS, no company line. I also met many people and had many interesting and thought provoking discussions outside the classrooms, and came away with new knowledge, ideas and inspiration. “Training you can’t get anywhere else” is an understatement.

Most of the speakers tell us 'why' and 'so what' instead of 'how'. This is what I expected and is good for developer in the long run. Please let speakers know this is good.

This is an excellent conference. I feel I updated my skills intensively effectively during these 3 days. I believe it will become a key event in .net area.

DevTeach was an amazing experience, especially for first timers. It was a good way to network with people in the industry, learn new techniques, make friends and bring home stories.

This was my first DevTeach and if I have any say in the matter, won't be my last. I had a great time, the sessions that I attended were top notch for the most part. Jean-Rene and his team deserve a hugh pat on the back for their efforts. What-ever they're getting paid - isn't half enough

What can I say. You'll definitely see me next year. I hope its still in Toronto. This was one of the BEST training conferences I've been on in quite some time. The "take-away's" from all the sessions were astounding. My mind is still spinning. Anyway, great job, nice prizes, great orgranization, absolutely no negative thoughts or comments.

This was a fantastic experience, MUCH better information than what I got from TechEd last year. TechEd's information was very visionary, things I can talk about now but not use for a few years out. DevTeach taught me things and gave me ideas I can use NOW! I LOVE THAT! The presentators were awesome, professional and very gifted at presenting their material. The only suggestions I would make are to have hot food every day (cold cut sandwiches are fine, even suggested for people at the Pre/Post Con but not for the actual event). More evening sessions (like at TechEd). I would have liked to have seen a presentation on MSBuild. PS You should have a value for the drop down of NA for hotel and accomodations if you didn't stay at the hotel.