Tuesday, December 25, 2007

Valid Reasons to Create a Routine

"Valid Reasons to Create a Routine", I've been trying to make the list of the reasons for few years, because 4 years ago I teach programming at my University. But it seems I can't explain it to myself either. Yeah of course I know (some of)the uses of routine, it just I can't put it into words.

Until lately, I read this sentence from title of a sub-chapter on a book called "Code Complete" by Steve McConnell. Currently I read only 170 pages from 850 pages of the book, but no doubt, this is one of the best book I ever read. If you are a programmer, you better read this book. :)

Here's the list that the book wrote:
- Reduce complexity
- Avoid duplicate code
- Support sub classing
- Hide sequences
- Hide pointer operations
- Improve portability
- Simplify complicated boolean tests
- Improve performance

There's description for every point stated above in the book, and I couldn't agree more with the list. So buy the BOOK. Thanks Steve for the knowledge. :)



No comments: