Title: Becoming a Pragmatic Programmer
1Becoming a Pragmatic Programmer
Terry Cheng Nov 18, 2004
2- Why do I choose this topic
- What to expect for todays seminar
- What is a pragmatic programmer
- Why is becoming a pragmatic programmer so
important - The keys to becoming a pragmatic programmer
3What is a pragmatic programmer
- Useful, workable, and practical
- Care about you craft
- Think about your work
4Why is becoming an pragmatic programmer so
important
- What I have seen in the pass two years
- My view of Chinas 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
5The 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
6Attitude, 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
7Behavior 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
8Behavior 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
9Programming 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
10Programming tips,Avoid duplication Code, doc, data
- Inadvertent duplication
- Mistakes in design, modeling
- Normalize data, avoid derived data
- Isolated duplication to the inner layer
- Example
11Programming 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.
12Programming tips,Avoid duplication Code, doc, data
- Impatient duplication
- Laziness, taking shirt cut
- Resist temptation, keep big picture and long term
view.
13Programming 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
14Design and planning
- Trace bullet
- Prototype
- Unit test
- Push decision to runtime
15When 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
16Few important believes
- Quality is number 1. 1,10,100 rule
- 1,10,100 rule apply to everywhere
- Maintenance cost is higher than development
- Chinas software future is in you hands, start
with be a Pragmatic Programmer
17QA
- Before we start, 2 direction of your career