Cover image for Becoming a Better Programmer

Book description

Pete Goodliffe, author of Code Craft, presents several lessons that will help you go beyond just being a good coder. You’ll learn how to become a better worker, a better team member, and even a better person. This is a book for people who care about code, who are passionate about the way they create it, and who want to do an even better job.

Table of Contents

  1. Dedication
  2. Also by Pete Goodliffe
  3. About the author
  4. Introduction
    1. What’s covered?
    2. Who should read this?
    3. The structure
    4. A note for mentors
    5. Acknowledgements
  5. 1. Care About The Code
  6. I. At the Codeface
    1. 2. Keeping Up Appearances
      1. Presentation is powerful
      2. It’s about communication
      3. Layout
        1. Structure well
        2. Consistency
      4. Names
        1. Avoid redundancy
        2. Be clear
        3. Be idiomatic
        4. Be accurate
      5. Making yourself presentable
      6. Conclusion
    2. 3. Write Less Code!
      1. Why should we care?
      2. Flappy logic
      3. Duplication
      4. Dead code
      5. Comments
      6. Verbosity
      7. Bad design
      8. Whitespace
      9. So what do we do?
      10. Conclusion
    3. 4. Improve Code By Removing It
      1. War story
      2. Code indulgence
      3. It’s not bad, it’s inevitable
      4. So what?
      5. Waking the dead
      6. Surgical extraction
      7. Conclusion
    4. 5. The Ghost of a Codebase Past
      1. Presentation
      2. The state of the art
      3. Idioms
      4. Design decisions
      5. Bugs
      6. Conclusion
    5. 6. Navigating a route
      1. A little help from my friends
      2. Look for clues
      3. Learn by doing
        1. Low-hanging fruit
        2. Inspect the code
        3. Study, then act
        4. Test-first
        5. House-keeping
        6. Document what you find
      4. Conclusion
    6. 7. Wallowing in Filth
      1. Smell the signs
      2. Wading into the cesspit
      3. The survey says…
      4. Working in the sandpit
      5. Cleaning up messes
      6. Making adjustments
      7. Bad code? Bad programmers?
    7. 8. Don’t Ignore That Error!
      1. The mechanism
      2. The madness
      3. The mitigation
      4. Conclusion
    8. 9. Expect the Unexpected
      1. Errors
      2. Threading
      3. Shutdown
      4. The moral of the story
    9. 10. Bug Hunting
      1. An economic concern
      2. An ounce of prevention
      3. Bug hunting
        1. Lay traps
        2. Learn to binary chop
        3. Employ software archaeology
        4. Test, test, test
        5. Invest in sharp tools
        6. Remove code to exclude it from cause analysis
        7. Cleanliness prevents infection
        8. Oblique strategies
        9. Don’t rush away
      4. Non-reproducible bugs
      5. Conclusion
    10. 11. Coping With Complexity
      1. Blobs
      2. A case study: Reducing blob complexity
      3. Lines
      4. And finally: People
      5. Conclusion
    11. 12. A Tale of Two Systems
      1. The Messy Metropolis
        1. Incomprehensiblity
        2. Lack of cohesion
        3. Unnecessary coupling
        4. Code problems
        5. Problems outside the code
        6. A postcard from the Metropolis
      2. Design Town
        1. Locating functionality
        2. Consistency
        3. Growing the architecture
        4. Deferring design decisions
        5. Maintaining Quality
        6. Managing technical debt
        7. Tests shape design
        8. Time for design
        9. Working with the design
      3. So what?
  7. II. Practice Makes Perfect
    1. 13. Software Development Is…
      1. This software (food)stuff
      2. Software development is… an art
      3. Software development is… a science
      4. Software development is… a sport
      5. Software development is… child’s play
      6. Software development is… a chore
      7. Metaphor overload
    2. 14. Playing by the Rules
      1. We need more rules!
      2. Set the rules
    3. 15. Keep It Simple
      1. Simple designs
        1. Simple to use
        2. Prevents misuse
        3. Size matters
        4. Shorter code paths
        5. Stability
      2. Simple lines of code
      3. Keeping it simple, not stupid
      4. Assumptions can reduce simplicity
      5. Avoid premature optimisation
      6. Sufficiently simple
      7. A simple conclusion
    4. 16. Use Your Brain
      1. Don’t be stupid
      2. Avoid mindlessness
      3. You are
    5. 17. Nothing Is Set In Stone
      1. Fearless change
      2. Change your attitude
      3. Make the change
        1. Design for change
        2. Tools for change
        3. Pick your battles
      4. Plus ça change
    6. 18. A Case for Code Reuse
      1. Re-Use case 1: The copy-pasta
      2. Re-Use case 2: Design for reuse
      3. Re-Use case 3: Promote and refactor
      4. Re-use case 4: Buy in, or reinvent the wheel
    7. 19. Effective version control
      1. Use it or lose it
      2. Pick one, any one
      3. Storing the right things
        1. Answer one: Store everything
        2. Answer two: Store as little as possible
        3. Storing software releases
        4. Repository layout
      4. Use version control well
        1. Make atomic commits
        2. Sending the right messages
        3. Craft good commits
      5. Branches: Seeing the wood for the trees
      6. The home for your code
      7. Conclusion
    8. 20. Getting one past the goalpost
      1. Software development: shovelling manure
      2. A false dichotomy
      3. Fix the team to fix the code
      4. Releasing a build to QA
        1. Test your work first
        2. Release with intent
        3. More haste, less speed
        4. Automate
        5. Respect
      5. On getting a fault report
      6. Our differences make us stronger
      7. Pieces of the puzzle
    9. 21. The Curious Case of the Frozen Code
      1. Hunting the code freeze
      2. A new world order
      3. Forms of freeze
      4. Branches make it work
      5. But it’s not really frozen!
      6. Length of the freeze
      7. Feel the freeze
      8. The end draws near
      9. Antifreeze
      10. Conclusion
    10. 22. Please Release Me
      1. Part of the process
      2. A cog in the machine
        1. Step 1: Initiate the release
        2. Step 2: Prepare the release
        3. Step 3: Build the release
        4. Step 4: Package the release
        5. Step 5: Deploy the release
      3. Release early and often
      4. And there’s more…
  8. III. Getting Personal
    1. 23. Live to Love to Learn
      1. What to learn?
      2. Learning to learn
      3. Learning models
        1. The knowledge portfolio
      4. Teach to learn
      5. Act to learn
      6. What have we learnt?
    2. 24. The Ethical Programmer
      1. Attitude to code
      2. Legal issues
      3. Attitude to people
        1. Team mates
        2. Manager
        3. Employer
        4. Yourself
      4. The Hippocodic Oath
      5. Conclusion
    3. 25. “Test-Driven” Developers
      1. Driving the point home
      2. Success breeds complacency
      3. Testing times
      4. Test-driven developers
      5. Conclusion
    4. 26. Relish The Challenge
      1. It’s the motivation
      2. What’s the challenge?
      3. Don’t do it!
      4. Get challenged
      5. Conclusion 
    5. 27. Avoid Stagnation
      1. Your skills are your investment
      2. An exercise for the reader
      3. Job security
    6. 28. A Love For Languages
      1. Love
      2. Love your language
      3. Cultivating your language relationship
        1. Love and respect
        2. Commitment
        3. Communication
        4. Patience
        5. Shared values
      4. A perfect metaphor?
      5. Conclusion
    7. 29. Posturing Programmers
      1. Basic computer posture
        1. The debugging posture
        2. When it’s really going badly
        3. The all-nighter
        4. Intervention from above
        5. The all-clear
        6. Design time
      2. Eye strain
      3. Conclusion
  9. IV. Getting Things Done
    1. 30. Smarter, Not Harder
      1. Pick your battles
      2. Battle tactics
        1. Reuse wisely
        2. Make it someone else’s problem
        3. Only do what you have to
        4. Put it on a spike
        5. Prioritise
        6. What’s
        7. One thing at a time
        8. Keep it small (and simple)
        9. Don’t defer and store up problems
        10. Automate
        11. Error prevention
        12. Communicate
        13. Avoid burn-out
        14. Power-tools
      3. Conclusion
    2. 31. It’s Done When It’s Done
      1. Are we there yet?
      2. Developing backwards: decomposition
      3. Define done
      4. Just do it
    3. 32. This Time I’ve Got It…
      1. Desert island development
      2. Stood at the bottom of the mountain
  10. V. The People Pursuit
    1. 33. People Power
      1. What to do
      2. Know your experts
      3. 20/20 Hindsight
    2. 34. It’s The Thought That Accounts
      1. Stretching the metaphor
      2. Accountability counts
      3. Code++
      4. Making it work
      5. Setting the standard
      6. The next steps
      7. Conclusion
    3. 35. Speak Up!
      1. Code is communication
        1. Talking to the machines
        2. Talking to the animals
        3. Talking to tools
      2. Interpersonal communication
        1. Ways to converse
        2. Watch your language
        3. Body language
        4. Parallel communication
      3. Talking of teams
      4. Talking to the customer
      5. Other communication
      6. Conclusion
    4. 36. Many-festos
      1. A generic manifesto for software development
      2. OK, OK
      3. The manyfestos
      4. But, really?
      5. The punchline
    5. 37. An Ode To Code
      1. Coding is a people problem
    6. Epilogue
      1. Attitude
      2. Go forth and code
    7. Revision History
    8. Index
  11. Copyright