Please enable JavaScript to use CodeHS

CodeHS Glossary


Programming Style General

The way your code is written is the style. It covers the aspects of the code that goes beyond whether or not it just works. There are several aspects to programming style, which you can read more about on their specific pages. - [Indentation][1] - [Decomposition][2] - Making your [program read like a story][3] - Using naming conventions like [`lowerCamelCase`][4] - Not using [Magic Numbers][5] - Using [Constants][6] when appropriate - Not using [Nested Functions][7] - Writing [Comments][8] ---------- On CodeHS, your program is graded not only on whether or not the program works, but also based on its style. Programs are not just meant for computers to run but for humans to read. This means that it is really important to communicate well and use good programming style. Having a program that works but has bad style will receive the grading status of Functionality Approved. This means that your code works, but you need to improve your style before you can pass. [1]: http://codehs.com/glossary/term/15 [2]: http://codehs.com/glossary/term/7 [3]: http://codehs.com/glossary/term/9 [4]: http://codehs.com/glossary/term/1 [5]: http://codehs.com/glossary/term/14 [6]: http://codehs.com/glossary/term/13 [7]: http://codehs.com/glossary/term/16 [8]: http://codehs.com/glossary/term/18