sharp bites

standing on the shoulders of giants

The road to Continuous Integration. Part 1: Get your source under control!

time-machine If you are not already doing so, put your stuff under source control. Right now. It doesn’t matter how small your project is or whether you are working alone. If it’s worth your time, it’s worth putting it under source control.

What is Source Control?

Source control, often referred to as VCS (Version Control System) or SCM (Source Code Management) is the management of changes in files. It’s a time machine that lets you see how your project looked like at any given point in time.

For a more detailed introduction, see Eric Sink’s Source Control HOWTO or the SVN book.

Why you should use a SCM tool

It gives you an infinite undo-button. No matter how much you have screwed up, you can always go back to a stable point.

You can share code with other people.

You can keep track of your changes over time. This allows you to know who changed what, when and (luckily, if you use meaningful comments) why.

You can maintain multiple code bases of your software. Even if you only have one active version at a time, it’s useful to start new development independently.

What should you store?

Everything you need to build your product. That includes your sources, of course, but also any libraries your projects depends on (avoid referencing GAC’ed or installed libraries), any tools you use and any scripts that you need as part of the process. Nothing should be dependent of your machine installation.

The goal is to be able to get into a clean machine, get a copy of the codebase from your source repository, build it (automatically) and voilà, you are done and ready to start working!

WHICH SCM ARE YOU?

There are many alternatives, just pick one, (oh well, not THAT one). If you don’t want to set up and maintain a server, you can use one of the many online services available (some of them are just for open source projects, and some have free and paid plans). Which one is best will depend on your specific needs:

If you…
  • want an easy to install, easy to start tool -> svn
  • want a powerful tool, at the expense of a bit steeper learning curve -> git, mercurial, bazaar
  • need to use a mature GUI/integration with Visual Studio -> svn, tfs
  • need good branching and merging support -> git, mercurial, bazaar
  • need an all-in-one tool (source control, bug tracking system, continuous integration) completely integrated, even if the individual tools are not-so-great for the -> tfs
  • are a Microsoft-only shop -> tfs

For the clients there are also a myriad of tools available for all platforms. You have command-line interfaces, standalone GUI tools (tortoisesvn, tortoisehg, tortoisegit) and IDE integrated (VisualSVN, AnhkSVN, Git Extensions).

Agile enterprise culture

Some highlights:
“The real company values, as opposed to the nice-sounding values, are shown by who gets rewarded, promoted or let-go”
“The Keeper Test: ‘Which of my people, if they told me they were leaving in two months for a similar job at a peer company, would I fight hard to keep?’”
“You should periodically ask your manager: ‘If I told you I were leaving, how hard would you work to change my mind?’”
“In procedural work, the best are 2x better than the average.”
“In creative work, the best are 10x better than the average, so huge premium on creating effective teams of the best”
“Vacation policy and Tracking: there is no policy or tracking”
“One outstanding employee gets more done and costs less than two adequate employees”
“It is a good idea, not a traitorous idea, to understand what other firms would pay you, by interviewing and talking to peers at other companies”
Three Tests for Top of Market for a Person:
1. What could person get elsewhere?
2. What would we pay for replacement?
3. What would we pay to keep person?
“We should celebrate someone leaving for a bigger job that we didn’t have available to offer them”
“If manager would promote employee to keep them […], manager should promote him now, and not wait”
“Mediocre colleagues and unchallenging work is what kills progress of a person’s skills”

The road to continuous integration

road After my introductory post in the AltNerdDinner series, I thought it would be a good idea to roll out an independent series of posts about the things I have learnt in the past two years on setting up a code base for continuous integration. Nothing really new under the sun, but it might help a few people to get started.
I will update this post with links backs to each element of the series.
Part 1: Get your source under control

Part 2: Shake your tree

Part 3: Script it, build it, test it, break it, fix it. Commit it

Introducing AltNerdDinner

This is the first in a series of posts in my quest to get my hands dirty with ASP.NET MVC framework, MVCContrib, Spark, NHibernate, FluentNhibernate, Linq2NHibernate, Windsor and a whatnot. For that, I have decided to take NerdDinner for a spin (not extremely original, I know), replacing what I think could be better and extending from there. If you are interested, you can have a look at the AltNerdDinner repository on github.

Here is a list of the posts published so far:

Part 1: Removing unwanted dependencies

Part 2: Rich Man’s Dependency Injection

Part 3: Introducing Fluent NHibernate. Mapping, the easy way

Part 4: Introducing NHibernate. Because POCO is enough

TDD Masterclass

Roy Osherove is giving an hands-on TDD Masterclass in the UK, September 21-25. Roy is author of “The Art of Unit Testing” (http://www.artofunittesting.com/), a leading tdd & unit testing book; he maintains a blog at http://iserializable.com (which amoung other things has critiqued tests written by Microsoft for asp.net MVC - check out the testreviews category) and has recently been on the Scott Hanselman podcast (http://bit.ly/psgYO) where he educated Scott on best practices in Unit Testing techniques. For a further insight into Roy’s style, be sure to also check out Roy’s talk at the recent Norwegian Developer’s Conference (http://bit.ly/NuJVa).

Full Details here: http://bbits.co.uk/tddmasterclass

bbits are holding a raffle for a free ticket for the event. To be eligible to win the ticket (worth £2395!) you MUST paste this text, including all links, into your blog and email Ian@bbits.co.uk with the url to the blog entry. The draw will be made on September 1st and the winner informed by email and on bbits.co.uk/blog

It’s the people, stupid!

You need people who are passionate about what they do. People who care about their craft — and actually think of it as a craft. People who take pride in their work, regardless of the monetary reward involved. People who sweat the details even if 95% of folks don’t know the difference. People who want to build something great and won’t settle for less. […]Anyhow, when you find those people, hold onto them. In the end, the folks on your team will make or break your project — and your company.
Getting Real, 37signals

Excellence

We are what we repeatedly do. Excellence, then, is not an act, but a habit.
Aristotle

On value types vs reference types and premature optimization

Eric Lippert, wrote a great post about value types vs reference types, and how, many times, the discussion is shifted to the-heap-and-the-stack, when it should really be about the differences when those types are passed (by value) as parameters.

He nails it when he says:
Making the nano-optimization of making a type that really should be a ref type into a value type for a few nanoseconds of perf gain is probably not worth it. I would only be making that choice if profiling data showed that there was a large, real-world-customer-impacting performance problem directly mitigated by using value types. Absent such data, I’d always make the choice of value type vs reference type based on whether the type is semantically representing a value or semantically a reference to something.

To plan or not to plan

In preparing for battle I have always found that plans are useless, but planning is indispensable.
Dwight D. Eisenhower