Skip to main content
Engineering LibreTexts

2.2: The Importance of Good Looking Code

  • Page ID
    29015
  • Why Looking Good is Important

    There is a contest - The International Obfuscated C Code Contest - who's goal is to: 1) to write the most Obscure/Obfuscated C program within the rules; 2) to show the importance of programming style, in an ironic way; 3) to stress C compilers with unusual code; 4) to illustrate some of the subtleties of the C language; and 5) to provide a safe forum for poor C code. :-). The term obfuscate means to make something obscure, not easy to understand. Go and look at their web site - the code is there. This is how you should NOT!! write your code. Code written to be obscure will not get you very far as a software developer, so lets set down some ground rules for this class.

    As a software professional you sit in front of a computer day after day crunching out code. A true professional will take pride in their work, and ensure that the code is more than just some characters typed into a file that gets the job done. It takes a true "code master" to write code with style. As affirmed by the Obfuscated code contest, we can write code that does something, and at the same time is difficult to read, almost impossible for anyone else but the original programmer to debug, and is a maintenance nightmare.

    If you continue to pursue the world of software engineering as career, you will find opportunities for promotions as you gain experience. The code you worked on ever since you started your current position will now become the responsibility of someone else to continue to develop and to maintain once the project is released for public use. If you wrote good code, followed some of the ideas we are going to talk about, that person will be grateful for your extra effort to write readable, understandable code.

    Writing good code has several concepts that will discuss in the next few pages. These concepts will be required in all the code you write this class as well:

    • Documentation
    • Decomposition
    • Naming
    • Use of the language
    • Formatting