When you haven’t done it yourself, it’s hard to imagine the effort that goes into writing a book. Not just a couple of chapters, but an entire book. Sometimes, we hear complaining about the lack of in depth books, but we guess that a lot of people don’t realize that the more in depth a book gets, the more work it is to write, and the smaller the audience for the book becomes. Because of this mechanism, with a new product release you’ll see lots of books getting published covering more or less the same grounds.

When we were technical reviewers of the book “Taming Text” it became quite clear that this was one of those rare cases where a very specific topic gets covered in great depth. We have one fear for this book, the fear that the audience for this book will be so small that the end result won’t be very satisfying for the authors. This is undeserved, as it is a great book.

What is it about? Basically, it covers how to find, organize, and manipulate text. It discusses topics such as:

It has been quite some time since we looked at the NDepend tool (http://www.ndepend.com/). We remember reading a Robert C. Martin book and were enthusiastic about his ideas about assembly dependencies. Back then, we were pleasantly surprised to find out that there was a tool based on the ideas of Robert C. Martin, and did some experimenting with it, but for some reason the tool didn’t quite fit in our development process.

Recently, we took another look at the tool and were pleasantly surprised by the way it has evolved. It has been designed to participate in Continuous Integration (CI) scenarios, has become a full-blown code analysis tool including nice reporting capabilities, and the documentation and ease of use are top notch. The feature we like best of all is the little amount of effort it takes to create your own code rules, something we have really want for some time and found to be lacking in the standard Visual Studio Static Code analysis features.

Let’s take a moment to discuss some of the other features…

There’s a visual tool that allows you to inspect NDepend projects (that analyze your own VS projects) without having to start Visual Studio separately.

As said before, our favorite feature is the ability to quickly create new code rules. You can do this just by using some Linq code and learn from the examples. For instance, the next code rule checks for methods that are considered to be too big:

// If you don’t want to link NDepend.API.dll, you can use your own attributes and adapt this rule.

// Eliminate default constructor from the result.

// Whatever the visibility of the declaring class,

// default constructors are public and introduce noise

// in the current rule.

!( m.IsConstructor && m.IsPublic && m.NbParameters == 0) &&

// Don’t decrease the visibility of Main() methods.

!m.IsEntryPoint

select new { m,

m.Visibility ,

CouldBeDeclared = m.OptimalVisibility,

m.MethodsCallingMe }

Finally an easy way to implement code rules specific to our own projects. All in all, we’re happy with our brand new toy! If you want to take it for a test spin you can get it here: http://www.ndepend.com/NDependV4.aspx.