Maintainable Code
- A big part of the idea of a software life cycle is that code
isn't just written and used.
- Instead code gets modified for years after it is initially written.
- Have you ever looked at code you wrote 2 years ago and couldn't
understand it?
- You may have to revisit old code, or look at someone else's code.
- What do you do to make it so other people can read and modify it.
- Comments, reasonable variable names (maybe a convention), and sensible
code structure are some things you can do.
- That stuff about encapsulation is about sensible code structure.
- How big do you make your functions? (Smaller is generally better.)
- Data hiding is important.
- Tests are important.