Chapter 4: Key Constructing Decisions

Choice of Programming

  • the programming language affects the productivity and code quality in several ways;
  • programmers working in a language they’ve used for three years or more are about 30% more productive than programmers with equivalent experience who are new to a language;
  • programmers with extensive experience with a programming language were more than three times as productive as those with minimal experience;
  • programmers working with high level languages achieve better productivity and quality than those working with lower level languages. Languages such as C++, Java, Smalltalk and Visual Basic have been credited with improving productivity, reliability, simplicity and comprehensibility by factors 5 to 15 over low lever languages such as assembly and C;
  • higher level languages are more expressive than lower level languages. Each line of code says more;
  • some languages are better at expressing programming concepts than others. The words available in a programming language for expressing your programming thoughts certainly determine how you express your thoughts and might even determine what thoughts you can express;
  • Check table 4-2. The Best and Worst Languages for Particular Kinds of Programs.

Programming Conventions

  • in high-quality software, you can see a relationship between the conceptual integrity of the architecture and its low-level implementation. The implementation must be consistent with the architecture that guides it and consistent internally. That’s the point of construction guidelines for variable names, class names, routine names, formatting conventions, and commenting conventions;
  • any large program requires a controlling structure that unifies its programming-language details. Part of the beauty of a large structure is the way in which its detailed parts bear out the implications of its architecture. Without a unifying discipline, your creation will be a jumble of poorly coordinated classes and sloppy variations in style;
  • before construction begins, spell out the programming conventions you’ll use. They’re at such a low level of detail that they’re nearly impossible to retrofit into software after it’s written.

Your Location on the Technology Wave

  • technology cycles, or waves, imply different programming practices depending on where you find yourself on the wave;
  • in mature technology environments – the end of the wave, you will benefit from a rich software development infrastructure. Advantages: multiple programming language choices, comprehensive error checking, powerful debugging tools, automatic performance optimization, almost bug free components, clear documentation, various books on subject etc;
  • in early wave environments, the situation is the opposite: few programming language choices, buggy components, poor documentation, you are most likely to be the first one to encounter an issue etc;
  • when working in a primitive environment try not to let your poor programming tools determine how to think about programming. Programmers who program “in” a language limit their thoughts to constructs that the language directly supports (if language tools are primitive, the programmers thoughts will be also primitive). Programmers who program “into” a language, first decide what thoughts they want to express and then they determine how to express those thoughts using the tools provided by their specific language;
  • if your language lacks constructs that you want to use or is prone to other kinds of problems, try to compensate for them. Invent your own coding conventions, standards, class libraries, and other augmentations.

Selection of Major Construction Practices

  • Part of preparing for construction is deciding which of the many available good practices you’ll emphasize. Some projects use pair programming and test-first development, while others use solo development and formal inspections. Either technique can work well depending on specific circumstances of the project;
  • See checklist;

Key Points:

  • every programming language has strengths and weaknesses. Be aware of the specific strengths and weaknesses of the language you’re using;
  • establish programming conventions before you begin programming. It’s nearly impossible to change code to match them later;
  • more construction practices exist than you can use on any single project. Consciously choose the practices that are best suited to your project;
  • your position on the technology wave determines what approaches will be effective—or even possible. Identify where you are on the technology wave and adjust your plans and expectations accordingly.