This is a topic that is near and dear to me. Readability is about being able to understand the code. Maybe the word should be “Understandability”, but that word suffers of the exact same thing it describes ;-)
Anyway, compare these two lines, and tell me what line you understand fastest:
1: startDate = new DateTime(2008, 5, 15);
2: startDate = 15.May(2008);
This might not seem much, but to me line 2 clearly states the intent of the code, whereas line 1 makes me think. I don’t want to think about how the code is implemented, I want the code to explain what it does, even why it does it.
Another one of these causes of confusion is the lambda extension from RhinoMocks x.Stub(x => x.DoStuff())… Every time I introduce mocking to a new team, I have a lot of explaining to do around the ‘Stub’ Extension. I recently introduced a change to the team for this one particular call. Compare these two:
1: userMapper.Stub(m => m.Map(user)).Return(viewUserDto);
2: When(userMapper).IsToldTo(m => m.Map(user)).Return(viewUserDto);
Again, this exercise might seem unnecessary, as experienced developers will instantly understand this. In my experience however, all developers tend to understand this kind of code without much effort.
Just my €0.02