Becoming a Pragmatic Programmer Terry Cheng Nov 18, 2004
Why do I choose this topic What to expect for today ’ s seminar What is a pragmatic programmer Why is becoming a pragmatic programmer so important The keys to becoming a pragmatic programmer
Useful, workable, and practical Care about you craft Think about your work What is a pragmatic programmer
Why is becoming an pragmatic programmer so important What I have seen in the pass two years My view of China ’ s Software Industrial Impact of quality of code in software development life cycle. Quality of code is not just no bugs It is important to your career
The keys to becoming a pragmatic programmer Attitude and philosophy Practical tips for you day to day work Two main principles of writing “ good ” programs Other helpful hints It is all in your head
Attitude, Style and Philosophy You have to care about what you produce You have to be proud of your work Willing to take responsibilities Attention to detail, yet have the big picture. Power of AND
Behavior Tips Care about your craft Think about you work Provide option do not make excuses Do not live with “ Broken window ” Be a catalyst for changes
Behavior Tips (cont.) Remember the big picture Think long term Make quality a requirement issue Invest regularly on your knowledge Critically analyze what you hear and read Not just what you say, also the way you say it Always think about maintenance and performance
Programming tips,Avoid duplication Code, doc, data Imposed duplication Project Standard, Multiple platforms, Language,.. Use of Macro, filter, code generator,. Documentation in code, only lowest level Document and code Language Issue
Programming tips,Avoid duplication Code, doc, data Inadvertent duplication Mistakes in design, modeling Normalize data, avoid derived data Isolated duplication to the inner layer Example
Programming tips,Avoid duplication Code, doc, data Inter-developer duplication Large team, parallel development Communication, centralize documentation, frequently low level design review. Just ask for it.
Programming tips,Avoid duplication Code, doc, data Impatient duplication Laziness, taking shirt cut Resist temptation, keep big picture and long term view.
Programming tips (Be orthogonal) Eliminate effects between unrelated things Gain productivity Reduce risk How to maintain orthogonal Design independent, well-defined components. Keep code decoupled Avoid global data Avoid similar functions, refactor when it is necessary Validate with unit test
Design and planning Trace bullet Prototype Unit test Push decision to runtime
When you code Code need to be easy to test Little accumulate can become huge Do not program by coincidence Do not assume, if you do not have choice, assume worst and doc them Do not be slave of history Refactor early, often. Make sure you have test before refactor Finish what you start Decouple wit balance
Few important believes Quality is number 1. 1,10,100 rule 1,10,100 rule apply to everywhere Maintenance cost is higher than development China ’ s software future is in you hands, start with be a Pragmatic Programmer
Q&A Before we start, 2 direction of your career