Saturday, 19 February 2011

Programming into a Language

Code Complete (Steve McConnell)
- Highlight Loc. 3021-31  | Added on Monday, February 14, 2011, 07:41 AM

Visual Basic didn't support this convention directly, but my use of a simple programming convention—programming into the language—made up for the language's lack of structure at that time and helped keep the project intellectually manageable. Understanding the distinction between programming in a language and programming into one is critical to understanding this book. Most of the important programming principles depend not on specific languages but on the way you use them. 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.

Programming into your language, according to McConnell, means not limiting your thinking only to the concepts automatically supported by the language. Instead, think about what you want to achieve and how you want to achieve and then, if your language doesn't automatically support that way of working, define conventions that you will use to meet your objectives.

This is a powerful concept, and something that every software craftsman should strive for. It's about personal discipline. Everyone knows that it's possible to write really hairy Perl code. It's also possible to write really beautiful Perl code.

No comments:

Post a Comment