Coding Style
Coding style refers to how you format your code.When the compiler checks
your program,it generally ignores spacing.However,when a person reads
your code,an easy to read,consistent style can make it much easier
to understand and maintain.This is quite logical,especially when talking
about writing a paper,but is often de-emphasized when writing a program.As
an example,note how diffucult this page is to read
because
it was not formatted properly
or consistently?
notice how difficult it is to understand, let alone
check for errors!
You will find that once you have taken the time
to learn a consistent style, writing your code will not take any extra time.
The benefit is that if your formatting is easy to read,consistent and
actually reflects the structure of your code,you will find that it takes
you much less time to organize your program,add new features to your code,
or fix errors.
There are a number of different styles that are considered good programming
style.Following the exact style used in this course is optional,but you
should learn
and use a consistent one that helps you avoid making mistakes
and makes the code easy for a person to read.
You can learn the style used in this
course by making your code match the
formatting used in the code examples.
particular style is being used.