Posts

Conversion excursion

My team's applications rely on a large array of assemblies, some C++, some VB6, and some C#. The front end is largely a web site that is a mix of ASP and ASP.NET. We also have some Windows services - mostly C++ with a few newer ones in C#. A few of the C# assemblies are COM enabled to be usable from the C++/VB code, ASP pages, and services while others are only used by the ASP.NET. We're trying to migrate away from the VB6 code so I helped compile a list of which of the assemblies are in use by which other components. Our first pass will be to perform a direct port with COM wrappers so existing code can simply point at the new object with no API or behavior change. As we do so, we'll make a note of places where we think there are existing bugs or room for performance improvements. Have you ever performed a massive migration or upgrade? How did your team go about it? What pitfalls did you encounter as you went? With the one assembly we've ported so far, we fo...

On-time, thoroughly tested, and on budget: pick two

I'm sure many of you in the the corporate would know the age-old conundrum of the post subject. It's difficult to deliver all the right fixes on the original schedule and budget for pretty much any project. No matter how much we expect the unexpected there will always be even more unexpected issues to derail the schedule. So how do you decide when to ship? We are performing a major rewrite of a component for our upcoming release and discovered an existing issue that would be very costly to fix. Now, we have three options: (1) fix it poorly, likely breaking something else in the process, (2) fix it correctly and delay the release, or (3) don't fix it in this release but slate it for future work. My manager and I have opted for number three after careful consideration. The driving factors were the value of the other improvements to the component even without this fix and the time constraints on other work included in the release. As soon as slipping the timeline became ...

Flow of control

I'm sure most experienced programmers already know that using exceptions for flow of control in a program is highly inefficient. The time it takes to unwind the stack alone is ridiculous, let alone the fact that compilers don't tend to optimize for exception paths. The question is then what to replace it with? Do you set status and return an empty or a null? Do you always return a "result" object that includes both the result state and any return types? My team is working on updating our shared components' architecture and are considering this question as we go. We've decided to move towards returning a result object and having "out" parameters for most of the new methods we're writing. While not ideal, this does mean we always use the same type of return value. We could also create subclasses of that return type with more propoerties instead of using out parameters. At the same time, I'm working on creating some unit tests for our new...

Moving up

The Duke Health Technology Solutions has offered me a full time position and I have decided to accept! This is a marvelous step forward and I'm very excited to join the team. It does mean that I'll have to pass off my current project to another contractor as I'll be shifting my job responsibilities, but I'm confident that the codebase is well commented and clean enough that it should be relatively easy for another software engineer to pick up where I'm leaving off. It's been a very interesting transition. The work environment here is much different than what I experienced at Microsoft. Here, the expectations and pressures seems to be much more reasonable whereas at Microsoft I would have been in dire straits if I did not work at least 50 hours a week. This could partly be my aptitude, but I think that everyone in the local office worked at least that much so I certainly wasn't alone. At Duke, while there will still be pressures of deadlines and deliver...

WCF and Silverlight debugging

As part of my latest updates to my current project, I made a change to the underlying WCF service that provides much of the information to our Silverlight application. In one of my DataContract classes, I started passing a child class to one of its DataMembers (i.e. the DataMember is a property on Foo, I passed in a Bar which is a subclass of Foo). Then, when Silverlight called the asynchronous version of that method, I started getting an ambiguous error: "The remote server returned an error: NotFound" I stepped through both the Silverlight side and my WCF side - no errors apparent either place. However, just after the return statement in WCF and method exit, the Silverlight's service reference would pop up the "NotFound" error. Strange, I thought... what's the problem? Other web searched seemed to direct me to update the buffer size, to delete and re-add the service reference, all to no avail. Finally, I changed the type on my datacontract's datamem...

Warning signs

Writing effect warning signs lesson #1: If the major reason to heed the warning doesn't get them to pay attention, give them a minor reason, too. Not only will this kill you, it will hurt you the whole time you are dying

Unit testing with Silverlight

I'm in favor of test driven development. The sooner you find bugs in the product cycle the less costly the are to fix, afterall. Currently, I'm working with Visual Studio 2008 SP1 with the Silverlight tools installed - my current project is a multi-tier system with DB backend, WCF web services, and a Silverlight client. However, when I added a test project and attempted to navigate to the Code Coverage tab of my test run config, the run config editor simply closed. I tried a few of the usual suspects - devenv /resetsettings, devenv /resetuserdata, repairing my Silverlight VS add-in installation - all to no avail. Then, after one MSDN search, I discovered that this is a known issue . The fix is available here and it's working for me so far. Hooray for test enablement!