“Coding style is very important. Code should be easy to follow and read. I speak from professional experience. NOT teaching the good coding style cheats the students.”
totally. aside from being correct and robust, style is everything, because great style is what allows others to understand and easily modify a code; great style also helps to prevent bugs and makes finding bugs easier.
style includes a large number of elements, including:
1. Extensive and USEFUL commenting
2. Indention and use of a large amount of space (as opposed to scrunching everything up)
3. Avoidance of multi-line statements
4. Avoiding use of complex, esoteric, and obtuse constructs, including avoiding uncommon language elements unless there’s a damn good reason.
5. And of course use of structured programming techniques, such as avoiding breaking out of complex, nested loop structures in a willy nilly fashion, etc.
Amen. I always say “I don’t care if your code works as long as I can read it we can fix it, if not, we toss it and start over”