September 2005 - Posts

iPod Nano, A Failure?

via Scoble.

Update: It seems that Apple have now responded :)

Posted by Mehran Nikoo | with no comments

NotImplementedException

NotImplementedException is raised when the body of a type member has yet to be implemented. In some applications, I have seen a scenario where a parent class is raising NotImplementedException to force the inheriting classes to override certain methods. It looks very familiar, doesn't it? Shouldn't we use an abstract member instead? Raising the exception defers the validation process to run-time rather than compile time, which is not desirable in most cases.

The other problem with NotImplementedException is that it should only be used when the body "is not implemented", YET! It is actually a strong form of a "TO-DO" task for developers, which will be enforced by the CLR. So when you release the code to production, your code should not raise this exception as it means that development is not complete. If you want to show that the feature is not going to be in the solution, then you should use NotSupportedException instead. Brad Abrams has a post on this subject.

Posted by Mehran Nikoo | with no comments
Filed under:

C# 3.0, LINQ, DLinq, XLinq, WCF, WPF, WWF, Acrylic, Sparkle, Quartz, ... Stack Overflow... Blue Screen!

C# 3.0 Specifications are published here. I really like LINQ, DLinq and XLinq. I think LINQ is a revolution in the framework. I am going to have a look at the samples and follow the hands-on labs here, here and here. Andres and his team rock!

I also want to try WWF.

Ohh, I nearly forgot to mention Acrylic, Sparkle and Quartz.

Same time last year I promised myself not to go after every product out there. Focus on a specific area and go from there. I tried to focus on .NET Framework, SQL Server and BizTalk Server. One year on, it is pretty challenging to focus on the framework itself (considering that WinFX is part of the game too). Now I wish I could just remember the product names!!!

I am excited... and confused :)

Posted by Mehran Nikoo | 1 comment(s)
Filed under:

Windows Foundation Family Getting Bigger

Before you start developing a custom workflow management solution, have a look at this.

"Windows Workflow Foundation" can be considered as a cut-down version of BizTalk orchestration and comes with WinFX so it can be used on Windows XP, 2003 and Vista and it is free :)

Posted by Mehran Nikoo | with no comments
Filed under:

Time Consuming Build Processes

The build process should not take too long to complete, especially the development build. I have seen many developers don't do it frequently because it takes more than say five minutes to complete. This is why they prefer to do it only over the coffee breaks or lunch time and I am sure there is no need to highlight why this is a BAD practice in an agile development process.

Those bloody unit tests" I can hear! Let's blame that web service call to the ERP application that takes more than a minute to complete. But why should another developer (who may not have any interest in that web service call) wait for a minute every time he performs a build? As the name suggests, unit tests are supposed to test the units, not the business processes or the whole system. A good unit tests should perform very fast, that is... in fraction of a second). This is the only way to convince developers to perform a build whenever they want to compile their application.

<!-- I will give you a hint for assessing whether your build process is taking too much time. As you may know, every Visual Studio 2005 project file is nothing other than an MSBuild script, so it can be customised to perform additional steps. Assume that you are going to add a step to the MSBuild script to perform the unit tests. Now the question is what is the maximum time you can wait for your application to be compiled, built and run before you start panicking? -->

This doesn't mean that we shouldn't have more comprehensive tests, the point is that those tests are not "unit" tests. You can add different tasks to your build script to reflect different types of testing, based on the context. The unit tests will run every time the build script is run, but developers should have the option of performing more comprehensive tests if they want to.

One could argue that a lightweight unit test does not necessarily cover all of the test cases. Correct, but performing a lightweight unit test is better than not doing it at all, because of its long duration. Also don't forget that the server build can be as comprehensive as you like it to be. The build servers have nothing to do apart from doing the build, so there is no harm in running all of the tests (including unit, system and integration tests) as part of the server build.

Even if the complete server build process takes say 20 minutes, it is better than running it on development machines over the coffee breaks, unless you have more than 8*3 coffee breaks at work! - Is your company is recruiting? ;) - . In such process, the maximum duration between producing and identifying a bug is 20 minutes, which is acceptable in most scenarios.

Posted by Mehran Nikoo | with no comments
Filed under:

Refactor!

I attended the VBUG evening event in London yesterday. Benjamin gave another excellent talk on Indigo (now WCF). During his talk and in order to amuse the audience, he showed us how cool Refactor! is.

Refactor! is a free plug-in for Visual Studio Basic 2005 Beta 2. If you pay for the Pro edition, then it will run on VS.NET 2002 and 2003 and it supports C# too. If you haven't seen it yet then go and check it out. The visual effects are amazing :) 

DeveloperExpress who are the author of Refactor! also have another productivity tool, "CodeRush". I have installed its evaluation edition at work and I liked it.

You can download Refactor! from MSDN.

Posted by Mehran Nikoo | 1 comment(s)
Filed under: