You are on page 1of 24

Seven Habits of

*
Highly Effective
Developers
* YMMV
Lee Chuk Munn
Staff Engineer
Sun Microsystems
chuk-munn.lee@sun.com
1 – Understand the Problem
• “Computer science is no more about computers
than astronomy about telescopes” - Dijkstra
• Programming is about problem solving
> Focus on the problem
> Programs are expression of the solution
• “Think outside the box” What if there is no box?
> Define the boundaries of the problem
• Bounce problem off people
> Do not isolate yourself
> Talk with a person face to face, avoid email if possible
> Never know where the discussion may lead
1 – Understand the Problem
• Avoid “The first solution syndrome”
> Resist the urge to pick the first solution or use the first
API especially if you are under pressure
• Research, research, research
> Real data, real use cases
2 – Use Appropriate Tools
• “If the only tool you have is a hammer, you will see
every problem as a nail” - Abraham Maslow
• Programming concepts and data structures
> Learn programming not programming languages
> Remember your basics
• Build a reservoir of design patterns
> Solutions to design problems
• Use a variety of tools
> Tendency is to stick with what we are comfortable with
> One per project is a good time frame to pick up tools
> Compare and contrast tools
2 – Use Appropriate Tools
• Do not be dogmatic
> The problem should dictate the tool, not the other way
round
• Use tools creatively
> Javadoc and XDoclet (Rickard Öberg)
• Develop your own tools if nothing is appropriate
> Project specific if need be
> Time spend on tool allows you to be efficient
> Might open new business opportunities
3 – Strive for Simplicity
• “Simple things should be simple. Complex things
should be possible” - Alan Kay
• Simplicity reflects your understanding of the problem
> Really easy to develop complex and convoluted systems
> Have you ever have a math question that says “make this
more complex” instead of “simplify” :-)
• Simplicity does not mean “simplistic”,
> Does not have to be crippled
> Tic-tac-toe is a simplistic game, Tetris is a simple game
3 – Strive for Simplicity
• Easy to understand, easy to explain, easy to
maintain, easy to document
> “... debugging is twice as hard as writing a program...”
• Steps I take to assume some degree of simplicity
> Assume that your users is at least as smart as you
> Do not duplicate functionality
> Jabber Carcassone game
> Try to use simple structures throughout
> Avoid XML when property files or JSON is sufficient
> If you are stuck, walk away to think about it
4 – Keep Your Code Clear
• “Indecision may or may not be my problem” - Jimmy
Buffett
• Code for others to read
> Chances are you will be reading it again
• Comment your code
> Especially if you are doing clever things
> You may forget the next week
• Keep methods short and simple
> Good indication is the names you choose for methods
4 – Keep Your Code Clear
• Only incorporate code that you understand
> Especially when you are copying it from somewhere else
> You cannot maintain what you do not understand
• Express your code in the idiom of that language
> Do not try to write Ruby programs like Java
• Aesthetics and layout of the code
> Nobodyisgoingtobeabletoreadevenifitisbrilliant
> Alt-Shift-F in most IDE reformat your code!!!!
• Fine line between abstraction and obfuscation
> Do not erase that line
5 – Learn to Debug
• “Each problem that I solved becomes rule which
served afterwards to solve other problems” - Rene
Descartes
• Bug comes and goes, debugging skill accumulates
> The debugging process is more important than the bug
• Do not assume – it usually is not what you think it is
> Read the stack trace / log files!!!!
• Collecting information is essntial to debugging
• Reduce the time to reproduce the bug
> Isolate the code by making a stand-alone version
5 – Learn to Debug
• Get a good tool to allow you to follow code
> Like reading a novel – difficult if words too small, or book
falling apart
> My favourite is vim and ctags / cscope
• Lay the foundation for debugging
> Logging/debug statements
> Asserts – supported since JDK 1.4
> MBeans for dynamically for stats, debug level, etc
• Write test cases to catch bug early
> “The Way of Testivus”
> http://www.agitar.com/downloads/TheWayOfTestivus.pdf
6 – Leverage What is Available
• “If I have seen further it is by standing on the
shoulders of giants” - Isacc Netwon
• Look for available solutions or algorithms
> Google is your friend, open source software
• Adopt a frameworks if possible
> Standardize the way an application is developed
> Application becomes robust on mature frameworks
• If you know someone who is a subject matter
expert, even better!
6 – Leverage What is Available
• Search appropriate forums and mailing list
> Your problem is not unique
> Be persistent - “I posted this problem 3 days ago and no
one answered me”.
> If you want it bad enough, it can be solved
• Start your own group
> Lots of resources, Yahoo Groups, Facebook are good
starting place
> Self help, self sustaining
• BragBlog about your predicament
> Solicit feedbacks
7 – Plan Ahead
• “It is better to know some of the questions that all the
answers” - James Thurber
• Anticipate what you will need in the near future
> Know where to get help, articles, books
• Off-the-job learning – no pressure to find a “solution”
> Visit a few technical sites for up todate developments
> Browse some good technical web sites for into – eg. Zotero
• Know the trends – what are you opinion of them?
> “There are two ways to slide easily through life; to believe
everything or to doubt everything. Both ways saves us from
thinking” - Alfred Korzybski
7 – Plan Ahead
• Be proficient in the tools that you are going to use
> Side projects (1 – 4 weeks) that uses it
> Side effect is keeping your programming / debugging /
typing skills sharp
• Learn from your past programs/codes, bad and
good
> All our projects have something to teach us
> “Happy families are all alike; every unhappy family is
unhappy in its own way.” - Leo Tolstoy
Summary
1.Understand the problem
2.Use appropriate tools
3.Strive for simplicity
4.Keep your code clear
5.Learn to debug
6.Leverage what is available
7.Plan Ahead
Seven Habits of
*
Highly Effective
Developers
* YMMV
Lee Chuk Munn
Staff Engineer
Sun Microsystems
chuk-munn.lee@sun.com