An opinion on “integrated solutions” like TFS and VSTS

As a response to Ben Scheirman’s post, Benjamin Day kindly apologized and summed up why he likes Visual Studio Team System and Team Foundation Server.

I am not going into the debate on whether it was right or wrong to delete that comment, because a lot of people already did that, and I agree with those who think that deleting the comment was kind of wrong. Calling it “unethical behaviour“, however, seems to be a little too harsh. Moderating news channels discussing politics in China is unethical – deleting a comment, because the blog author disagrees, is just weird and a little bit annoying.

Instead, I just wanted to chime in with my 2 cents on why I think Visual Studio Team System and Team Foundation Server are inferior, compared to ALL of the free alternatives that I know of – it’s because I believe in one of the finest principles of software engineering, which was coined by Edsger Dijkstra: Separation Of Concerns.

Separation Of Concerns can be low level, as in Uncle Bob’s single responsibility principle, or higher level as in service-orientation, or even higher level as in there’s NO WAY I’m gonna buy an oven, which insists on also being my washing machine and a pair of roller blades. No way!

This principle is so inherent in all the good disciplines of software engineering, heck in LIFE even, that I simply had to reply!

So I like to use CruiseControl, TeamCity, Subversion, Git, ReSharper, TestDriven, NUnit, xUnit.net, Jira, Redmine, Basecamp, MSBuild, Rake, NAnt etc. etc. because they let me switch each one of them out for anyone of the other whenever I feel like it. And, more importantly, whenever it fits the task better.

The fact that some of the tools are FREE and have their source code available for me to look at, is just an added plus. But the primary reason to use those tools is simply that they do one thing, and they are usually capable of doing that one thing better.

Book review: ASP.NET MVC 1.0 Quickly

This book is exactly what its title says: a quick introduction to ASP.NET MVC. A natural implication is that it cannot cover that much material, and it seems Maarten went for breadth instead of depth.

In my opinion, when a book chooses to be a “quick guide”, it should focus more on showing the preferred ways to do stuff. Instead, this book seems to have too much ViewData["stuff"] = fluff going on. Why bother wasting pages showing all the tedious, error-prone, hard-to-maintain ways to do stuff when there is so little space?

asp.net.mvc.quickly.quickly

If I were to author a book on ASP.NET MVC, I would focus on explaining ASP.NET MVC from the extensibility points and out. For example, System.Web.Mvc.Controller is just one way to implement the IController interface, and so on. I think that would provide a much more wholistic image of the framework, and the extensibility points is where ASP.NET MVC shines. I don’t think Maarten’s book really shows where the framework shines.

I enjoyed the chapter on using existing ASP.NET features though, and, not being an ASP.NET guy at all, I think I learned some stuff there.

My conclusion is that this book is absolutely for beginners, and that the code samples in the book should not be taken literally, because almost none of them are examples on what the community considers best practice.

Title: ASP.NET MVC 1.0 Quickly
Author: Maarten Balliauw
ISBN 10/13: 184719754X / 978-1847197542
Publisher: Packt Publishing

Task and issue tracking with Redmine on a Windows server

If you are in need of nifty and free task and issue tracking system, you could check out Redmine! It’s really cool, and it is easy to install (especially if your Windows box already has a Ruby development environment installed).

This post will show how Redmine can be installed as a Windows service on your Windows server. You will need to go through the following steps if you have a clean Windows machine, and you have not yet fiddled with Ruby on it:

  1. Install MySql
  2. Create a Redmine database + user
  3. Install Ruby 1.8.6
  4. Include the Ruby bin directory in your PATH environment variable
  5. Install Rubygems
  6. Install Rails
  7. Install Mongrel
  8. Install Mongrel Service
  9. Check out Redmine’s source code
  10. Configure Redmine
  11. Create the database schema
  12. Start Mongrel and verify that the installation works
  13. Install Mongrel/Redmine as a Windows Service
  14. Make the service run automatically when Windows boots

So… let’s do this!

1. Install MySql

Redmine needs a database. I use MySql for this. Go to http://dev.mysql.com/downloads/ and download and install the community server edition.

2. Create a Redmine database + user

Fire up a command prompt and enter (assuming that MySql is installed locally, running on the default port):

where USER might be root and PASSWORD is probably some secret cool password you made up during the installation of MySql.

Then, type

to create a new database for Redmine. Verify that it’s there by doing this:

Then, to create a new user for Redmine to use, and to grant full access to the database, do this:

3. Install Ruby 1.8.6

In Ruby land, 1.8.6 is still being used in many production environments around the world, even though Ruby 1.9 is well on its way. To install it, go to http://www.ruby-lang.org/en/downloads/ and choose the One-Click installer.

If you download the binaries instead, you will manually need to download a few missing dlls: zlib.dll, ssleay32.dll, iconv.dll and possibly more. Not too hard, but it’s definitely easier to use the One-Click installer.

4. Include the Ruby bin directory in your PATH environment variable

Not too hard – just do it! Mine says blablabla;c:\ruby-1.8.6\bin (not literally, though).

5. Install Rubygems

If you are unfamiliar with Ruby, I can inform you that Rubygems is the de facto standard package manager. Grab it from the downloads section of http://rubygems.org/, and put it somewhere on your computer. Then, open a command prompt in that directory and issue a

which will install gem.bat in your Ruby bin directory.

6. Install Rails

Redmine is built on the Rails frame work, so Rails must be installed for Redmine to work. Easy! Do it like this:

The -v 2.1.2 stuff is because my current version of Redmine required Rails 2.1.2. If your Redmine installation refuses to start up because it requires another version if Rails, it should be easy to install that version inspired by the command above.

7. Install Mongrel

Mongrel is a fast web server made in Ruby. Install it like this:

8. Install Mongrel Service

Mongrel Service is a Win32-specific thing, that allows Mongrel to be started via a Windows Service. Install it like this:

UPDATE April 4th 2010: When re-installing Redmine on a Windows 7 server today, I got this cryptic error message:

I Googled for a while before I thought about what Rubygems was trying to accomplish… It seemed like it was trying to run make on my Windows box, which is usually pretty hard… so I tried adding the platform parameter like so:

– which worked 🙂 I have no idea why the platform parameter is suddenly required to install successfully on a Windows box.
</update>

9. Check out Redmine’s source code

Look for instructions on how to obtain Redmine here. I have checked out the trunk on my computer – that makes it very easy to upgrade Remine whenever I feel like it.

10. Configure Redmine

Rails apps are easily configured by editing the files contained within the config folder of the Rails application. To configure Redmine to use your database when started in production mode, copy the database.yml.example file and call it database.yml. Edit the production section and supply the database name and user credentials you created in your MySql database.

11. Create the database schema

Rails applications have built-in database migration scripts. You can issue a full up to the current version by going to Redmine’s base directory in the command prompt and issue a

12. Start Mongrel and verify that the installation works

Open a command prompt in your Redmine app’s base directory and issue a:

to start Redmine on port 4000 in the production configuration.

Now you should be able to navigate to http://localhost:4000 and see Redmine running.

13. Install Mongrel/Redmine as a Windows Service

Open a command prompt as administrator (right click the command prompt shortcut and select “Run as administrator”) and navigate to your Redmine app’s base directory and issue a:

14. Make the service run automatically when Windows boots

Go to the service manager in Windows ( services.msc) and double-click your service to change the startup type to “Automatic”.