The Programmer's Brain cover
Welcome to liveBook!

This is an online version of the Manning book The Programmer's Brain. With liveBook you can access Manning books in-browser — anytime, anywhere.

front matter

foreword

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);

whereas this looks more reasonable:

tomorrow = today.PlusDays(1);

Compare that with the AddDays method in the .NET DateTime type:

date.AddDays(1);

That looks like it’s just modifying date, and isn’t a bug, even though it’s just as incorrect as the first example.

preface

acknowledgments

about this book

How this book is organized: A roadmap

liveBook discussion forum

about the author

about the cover illustration

sitemap