2. Purpose 1: Software development is a group effort
1. Lots of people are involved
2. Code is revisited very often
3. Cost of maintenance
3. Purpose 2: Code has to last long
Codebase is discarded when
1. It is not understood
2. It is not robust
3. It is not extensible
4. It is not efficient
4. What writing good code has got to do with sitting in
conference room?
1. To make you sensible to the topic
2. To set you on right path
6. Be sensible
1. Readability: clarity over cleverness
2. Consistency
3. Cyclomatic complexity
4. Responsible while changing code
7. Be robust
1. Least astonishment
a. No side effects
b. Re factor
2. Use correct data types
a. Makes code more maintainable
b. re-factoring is easy
3. Scope variables carefully
a. Don't spoil global name space
b. Don't reuse convenient variables/constants
8. Be Pragmatic
1. See the big picture
a. composition/cohesion – Design by contract
2. Understand the platform
a. memory model: String builder, boxing/unboxing
b. memory leaks
c. thread safety
9. Points to ponder
1. Error – To catch or not to catch
2. Exception model - http://c2.com/cgi/wiki?
UseExceptionsInsteadOfErrorValues
3. overloading - don't overload it
4. Out of band info
5. Boy scout principle
6. Don't re-invent, evolve
10. Suggested reading
1. Art of Unix programming - http://www.faqs.org/docs/artu/
2. Unmaintainable code - http://mindprod.com/jgloss/unmain.html
3. http://c2.com/cgi/fullSearch?search=
4. Pragmatic programmer
5. 97 things every programmer should know
6. Clean code