Dennis van der Stelt

The only way to win is to learn faster than anyone else

Community

Email Notifications

News

  • Addicted to Refactor! Pro

I read...

I Use...

Tags

Recent Posts

Archives

Blog Subscription Form

  • Email Notifications
    Go

March 2009 - Posts

Silverlight 3 SDK Beta 1

Via Twitter @MarcelMeijer and SDN site, that Silverlight 3 SDK Beta 1 was just released, a few hours before Mix09.

Best developer tools

Because of the nature of my work, coaching people on-site and training people in classes, I talk to a lot of developers and managers about the way people work. Unfortunately a lot of companies still don’t unit test their software and don’t setup an automated build. At times that’s specifically what we at Class-A are hired for. But if it’s not, we try to convince our customers that they gain by working with these practices.

Most companies want to professionalize and create better (quality) software. But for some reason, this can’t cost them anything. And I’m not talking about development time or learning curve, that’s a different story. I’m talking about the licensing cost of the tools you want or even need. For some reason people can’t lay down a few hundred dollars for something that will save them immense amounts of time, and thus money.

People rather spend countless number of hours on creating their own grid, whereas for a small amount of money you can buy a grid that has it all and can do it all, before you started thinking about it. People rather spend countless number of hours writing extra code, just to make it testable. People rather spend countless number of hours doing stuff that can be automated, generated or in some other way be helped with. I’m not sure about you, dear reader, but on my part this is unacceptable.

This blogpost is about my top 3 favorite products for developing software. Each one of them costs money, while there are free alternatives. But they’re in this list because they make developing software so much easier, that they pay back the investment within a matter of weeks or sooner.

 

  1. FinalBuilderMainScreenshot FinalBuilder
    This is a tool to setup automated builds via a really great user interface. It has over 600 actions to perform, like copy files, compile projects, source repository actions, archiving, flow control, etc, etc.

    With FinalBuilder you can setup these actions as steps and use advanced flows to guide builds through your steps. Work with variables, action panes with arguments that kind of behave like methods and much more. When a customer uses FinalBuilder, we try to automate everything; from build to deploying applications, services, databases and more.

    The best part is that everything works with a great user interface, instead of the XML files that MSBuild & TeamBuild use. It’s really easy to track down what happened if things go wrong as FinalBuilder includes (historical) logs, also visualized. And if you’re using Team Foundation Server 2008, there’s a great integration so you can start using FinalBuilder from within TFS. And if you don’t have TFS or a useful Continuous Integration server, you can use FinalBuilder Server.

    If you still setup a build without FinalBuilder, I urge you to download the trial and see for yourself how powerful and user friendly it is. And if you need help, you know where to find me.

    http://www.finalbuilder.com/
  2. Typemock Isolator
    typemock More and more people start writing unit tests and eventually start using a mocking framework. Although there are more frameworks and they’re even free, in my experience it’s unbelievable how powerful Typemock Isolator is.

    A great feature about Typemock Isolator is also that you don’t specifically have to design your code to be testable. Of course it’s a good practice to decouple using interfaces and what else. But if you need to decouple, using IoC and such just because else your code would not be testable, it’s not a good thing. You need those things for a good design, not a testable design. That’s where Typemock Isolator can help, simply because of its power. A few examples:

    1. You can swap out instances you normally can’t control from the outside and even use duck-type swapping.
    2. The SharePoint object model is extremely large, but Typemock Isolator makes it easy to create fakes by using a feature called Recursive Fakes. More info here.
    3. Scott Hanselman believes in it as well, as you can read in this case study.

    http://www.typemock.com/
  3. Refactor! Pro
    refactor There are multiple, so called, productivity tools. One of the most well known is Resharper, which I have a dislike for. First of all, it messes up my Visual Studio completely, which means my students won’t know when Resharper is doing something and when Visual Studio is doing something. You also have DevExpress CodeRush, one I like far better, but also changed Visual Studio a lot.

    Refactor! Pro is a tool, also by DevExpress. This tool doesn’t invade into Visual Studio too much, but has a great power for refactoring. You have to learn how to use the tool, as there still aren’t many small tips on the DevExpress website, which I think is a shame. The fact that you not only have to know which refactorings are available, but also where to place the cursor to enable the refactoring. But when you do learn, it gives you great advantage, especially when doing Test Driven Development where you have to refactor a lot of code.

    Again, a great tool to enhance productivity which eventually pays itself.

    http://devexpress.com/refactor/

Again, if you really want to gain in productivity and think this is worth money, buy these tools.

If you want to lag behind, have less control over what you’re doing and don’t think quality is something your customers need, don’t…

Azure and Virtual Machine hours

I suddenly remember that Azure can supply you with analytics on how your services and storage is doing, so I wanted to check this. Some funny results came out of this.

First of all, these statistics are about my speed traps application I blogged about before. It’s nice to know what it actually does.

  1. The application is running two roles:
    1. A web role for displaying an HTML page to the users with all speed traps. This role also has a WCF service running in the same web role.
    2. A worker role for retrieving the speed traps from my external source.
  2. The application itself checks every 10 minutes if there are speed traps available. No matter if it finds any, it deletes all entries in the database and stores all found entries in the database again.

So here are the statistics for my service and my website. Urls can be found in the previous post.

vmhours_hourly_usage vmhours_daily_usage

In the left image you can see the number of VM hours used every hour. This means that every hour of the day, I use up 4 hours of VM usage. This results in 96 VM hours per day. Which is kind of weird, as you get a max of 2000 VM hours per trial-key, which means my service should not be able to run for 21 days straight. Meaning that my speed traps service should start failing any day now! Here’s how…

We have the production and staging environment. The staging is of course to test if your application works, so you can more confident release it to production. For every environment you can have both a worker role and a web role. Both of these have, as Microsoft states, their own virtual machine. So as I ran one production version with both a web- and worker role, I use up two virtual machine hours per hour. But as I still had my staging environment running as well, I was using up 4 virtual machine hours per hour. And as you get 2000 VM hours per token you receive from Microsoft, my service won’t be running for 21 days straight. So I immediately suspended and deleted my staging environment, hoping I can now extend my speed traps service for 5 more days. ;-)

The following two pictures are about my storage. In the left image you can see the daily network usage in megabytes. Per day I transfer a maximum of about 2 megabytes. On the right side you can see the daily storage usage in megabytes as well. The funny thing is, as I’ve told, that every time before I store the latest speed traps, I delete all current available in my table storage. But still I use up to 40 MB of storage per day. Is that accumulated? No idea.

storage_networkusage storage_mbstored

Attach to debugger script and shortcut

I got sick of manually attaching to the webserver (either aspnet_wp.exe on WinXP or w3wp.exe on Win2003 or later). You can have a macro for that, incl. a shortcut key. I got this from somewhere on the web, but forgot where. If I find out, I’ll of course post it here. But I constantly have to search my sent items in Outlook for this bit of script when I tell someone about this. So here it’s on my weblog.

  • Press ALT-F11 (Macro IDE)
    A new Windows pops up
  • In the Project Explorer on the left, choose "Add new Item"
  • Choose a Module and name it "AttachToWebServer"
  • Paste the code below (and overwrite anything that was already there)
  • Close this Window
  • In Visual Studio, do "Tools" -> "Options" -> "Environment" -> "Keyboard"
  • In the textbox for "Show commands containing" type "AttachToWebServer"
  • In the "Press shortcut keys" press ALT F10
    It's currently bound to something you're not using anyway ;-)
  • Press "Assign" and "Ok"

Now go to your web application project and press ALT+F10 and you're in debug mode, attached to the webserver. Press F5 in your browser (of course in the correct website) and you're done!

Here’s the code:

Imports System
Imports EnvDTE80
Imports System.Diagnostics
 
Public Module AttachToWebServer
 
    Public Sub AttachToWebServer()
 
        Dim AspNetWp As String = "aspnet_wp.exe"
        Dim W3WP As String = "w3wp.exe"
 
        If Not (AttachToProcess(AspNetWp)) Then
            If Not AttachToProcess(W3WP) Then
                System.Windows.Forms.MessageBox.Show(String.Format("Process {0} or {1} Cannot Be Found", AspNetWp, W3WP), "Attach To Web Server Macro")
            End If
        End If
 
    End Sub
 
    Public Function AttachToProcess(ByVal ProcessName As String) As Boolean
 
        Dim Processes As EnvDTE.Processes = DTE.Debugger.LocalProcesses
        Dim Process As EnvDTE.Process
        Dim ProcessFound As Boolean = False
 
        For Each Process In Processes
            If (Process.Name.Substring(Process.Name.LastIndexOf("\") + 1) = ProcessName) Then
                Process.Attach()
                ProcessFound = True
            End If
        Next
 
        AttachToProcess = ProcessFound
 
    End Function
 
End Module
Visual Studio settings

I regularly forget, after re-installing my desktop or laptop, what settings I had configured in Visual Studio. Today I was looking for another one and decided to blog about it, for a personal reference. More will probably come to my mind or I get some cool tips from others, so I’ll update this post whenever this happens.

Tabs instead of spaces
As everyone knows, you need to setup tabs in Visual Studio and not have spaces inserted. The two main reasons is that every developer can decide for him/herself how many positions each tab will take from the side. The other reason is that tools to compare code will go nuts on spaces, thinking every line is changed.

tabsTrack items in solution explorer
When you’re inside some code, you’re not always sure which file in the solution explorer you’re working with, because jumping all files with the best shortcut keys might result in me getting lost. With this setting on, the solution explorer selects the file you’re working in.

track-item-solution-explorer

XAML Viewer, no designer
Most of the time I don’t work with the designer and I only want to see the XAML. Also because the designer takes a while to load, especially the first time. This makes sure the XAML is full screen when you click a WPF/Silverlight file.

xaml-viewer

Double-click failed test takes you to failing line in code
This option is very useful if you’re doing unit testing and your test fails. Instead of multiple clicks, one click on the error (the row in the testresults pane) take you immediately to the failing line.

failed-test-clickable