Category Archives: Code

The joy of being a programmer

I am programming since I am 10 and I am now 38. Today I measure how much good programming bring to my life, directly and indirectly. I’d like to give credit to aspects I love in my job. Hopefully some … Continue reading 

Also posted in Programming | Leave a comment

A Program to explore Code Diff

Recently I answered the question Generating a diff report using NDepend during build on stackoverflow. As explained in my answer, the easy way to go is to follow the documentation on Reporting Code Diff. But for the user that wants something smarter … Continue reading 

Also posted in Change summary, Changes, Code Diff, CQLinq, LINQ | Leave a comment

Ruling Code Quality Regression

A prominent characteristic of the software industry is that products are constantly evolving. All modern development methodologies prone that a product should evolve through small iterations. Internally, development teams are using Continuous Integration servers that shrink increment length to a … Continue reading 

Also posted in API usage, CC, Change summary, code base snapshot comparison, Code Diff, Code Query, Code Rule, code structure, CQLinq, Full Coverage, Immutability, Lines of Code, LINQ, Maintainability, NDepend, software metric, Software Quality Measurement | 1 Comment

The code is the truth, but it is not the whole truth

In a recent interview from Grady Booch, co-creator of UML, Grady said: When Jim, Ivar, and I began our journey that became manifest in the UML, we never intended it to become a programming language. I think that there’s a … Continue reading 

Also posted in CQL, Grady Booch, Truth | 9 Comments

Return False on the Happy Path

When you call a query method that returns true or false, I highly suggest that you make true results trip conditional logic / guard clauses / etc. I was driving out some code today in an MVC controller that had … Continue reading 

Also posted in Uncategorized | 3 Comments

Super Models, Part 2: Avoid Mutators

A quick disclaimer: we’re entering religious territory here. I feel strongly about this issue, but it’s certainly my opinion. If you want to get the full sense of how passionate people are about this issue, check out this article at … Continue reading 

Also posted in Uncategorized | 4 Comments

Test Your NHibernate Mappings!

Disclaimer! Ayende rightly points out that if you are testing your queries you get this mapping test for free. If you aren’t, well put this in place as a stop gap measure (to test mappings) and if you have queries, … Continue reading 

Also posted in Uncategorized | 3 Comments

Hook Methods

I’ve written about the template method pattern before. For my money it’s still a very useful pattern for building super lightweight frameworks and enabling the open-closed principle which states: Software entities (classes, modules, functions, etc.) should be open for extension, … Continue reading 

Also posted in Uncategorized | 69 Comments

Super Models, Part 1: Sexy Specifications

In Domain-Driven Design we turn to the specification pattern when we want to check whether an object matches some criteria. I think specification is the oft-forgotten bastard child pattern of the domain model pattern language. I know I frequently turn … Continue reading 

Also posted in Uncategorized | 2 Comments