front matter
I’ve spent a lot of my life thinking about programming, and if you’re reading this book you probably have too. I haven’t spent nearly as much time thinking about thinking, though. The concept of our thought processes and how we interact with code as humans has been important to me, but there has been no scientific study behind it. Let me give you three examples.
I’m the main contributor to a .NET project called Noda Time, providing an alternative set of date and time types to the ones built into .NET. It’s been a great environment for me to put time into API design, particularly with respect to naming. Having seen the problems caused by names that make it sound like they change an existing value, but actually return a new value, I’ve tried to use names that make buggy code sound wrong when you read it. For example, the LocalDate type has a PlusDays method rather than AddDays. I’m hoping that this code looks wrong to most C# developers
date.PlusDays(1);
tomorrow = today.PlusDays(1);
date.AddDays(1);