9.0 Introduction

Creating software is a complex, difficult task with specific goals: you need to solve the problem at hand, you need to write simple and maintainable code, and you need to write it in a manner that follows some time-proven standards.

Each project has its unique issues, but as you code, you will most likely want to follow some well-known and accepted approaches, such as using standardized naming conventions to ease readability, avoiding empty interfaces, and properly handling dispose methods.

Just as importantly, any given project will have a number of difficult logic problems to solve, and you’ll want to solve them as quickly as you can while keeping your software as simple as possible. Simple code helps you in many areas: it’s quicker to write, it’s easier to test, it almost always has fewer bugs, and it’s much easier to maintain when you have to return to the code months down the road.

Simple code has only a few paths of execution through it. It doesn’t have multiple nested loops or convoluted if/else branches; each of its methods, routines, and functions does one specific task. Simple code is a breeze to read through, and its intent can be grasped quickly.

Reading through complex code, on the other hand, will leave your head spinning. Complex code has functions that try to do multiple things instead of just one task. It’s full of nested if/else and logic loops, classes with thousands of lines of code, and methods hundreds of lines long. Complex code defies efforts ...

Get Windows Developer Power Tools now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.