- The Good Rules of Programming
Follow these as you begin your programming studies.
You will save time and writing code will be more enjoyable.
- Think about the logic before you write code. Write it on paper if you must.
- Select clear, simple, and meaningful variable names.
- Do not use lower case L(l) or upper case i(I) , because they both look the same, and both look like 1
- Do not user upper case O, because it looks like a zero 0
- Do not type all the code in at once, build slowly.
- Enter 3-5 lines at a time, and then test:
- (1) Does it compile?
- (2) Is it working?
- Enter 3-5 lines at a time, and then test:
- When the compiler detects an error, fix the first error (top-most) and then recompile.
- Fixing one error (top-most) may fix many dependent errors listed under it.
- The compiler will make a guess as to the location (line) of an error.
- Check the location indicated by the compiler and 1 or 2 lines above.
- With practice, you will detect and fix the errors quickly.
- Best way to learn is to write code, test adjust and rerun.
- Be creative! There are usually *many* ways to solve the same problem!
Python
Saturday, July 4, 2015
Basic Programming starts here
So I have done a little bit of programming before but I am new to Python and thought I would share the info from my class and what I have learned.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment