Upgrade to Pro — share decks privately, control downloads, hide ads and more …

WPCampus: Documentation for Developers

WPCampus: Documentation for Developers

Developers who love to write documentation are pretty rare. But, documentation is a critically necessary evil throughout a website’s life - from initial development through to ongoing support and enhancements. How much documentation is too much? Not enough? As developers, how can we produce meaningful documentation that supports our code and sets it up for success once it sails out into the world, without making ourselves completely crazy in the process?

We will explore a structure for documenting your technical requirements and layering them into your codebase, the components of strong documentation and how these project artifacts evolve over time.

**NOTE: You will need to download this deck to click links in the PDF.**

Katherine White

July 14, 2018
Tweet

More Decks by Katherine White

Other Decks in Technology

Transcript

  1. What we’ll discuss 01 02 03 Why it matters Audiences

    What to include 04 05 06 Keeping it fresh Making it happen Writing your docs
  2. You will be using your code
 in a year. Code

    you wrote six months ago looks like it was crafted by a mad genius. MAINTAINABILITY
  3. Someone else will be using your code in a year.

    Almost 35% of developers cite poor documentation as one of their primary frustrations at work, just behind “unrealistic expectations.” - Stack Overflow Developer Survey, 2016 MAINTAINABILITY
  4. You want people to use your solution. Consistency is always

    a challenge. People don’t use things that aren’t easy to figure out. ADOPTION
  5. You want to build a community. To encourage participation, people

    must grasp the value of the project and how they contribute to it. ADOPTION
  6. You want to write stronger, better code. If you want

    to be sure you understand it, explain it to someone else. PERSONAL GROWTH
  7. You want to improve your marketability. Practice makes perfect. The

    more you write, the easier it becomes. PERSONAL GROWTH
  8. Stakeholders • May or may not be technical • Understand

    the business requirements • Care about the organizational impact • Help pay the bills • Drive adoption (or death) of your project
  9. Implementers • Have a problem they need to solve •

    Varying degrees of technical facility • Strapped for time and resources • Need to interact with your functionality but not your code • Can be inside or outside your institution
  10. Developers • Adapt and extend your code • Interested in

    being part of your open source project • Technical teammates • Support the work long-term
  11. For Everyone ✓ What problem are you solving? ✓ How

    does the thing work? ✓ What are the major features? ✓ How do you install it? ✓ What is it built with? ✓ Where can you get help? ✓ When can you use it? ✓ What has changed between versions?
  12. For Developers ✓ How do you set up a local?

    ✓ How is your project architected? ✓ What are rules of the road? ✓ How is it tested? ✓ How is it deployed?
  13. Your writing matters. • Avoid overly technical jargon • Add

    links to supporting documentation • Add links to acronyms, technical terms, and third party tools STYLE
  14. Think in stories. User stories are a powerful tool for

    simplifying the explanation of what your code does and why. STYLE As a [user from the user group], I should [description] so that [user-centric reason/strategic benefit/business justification.]
  15. Be consistent. Update your documentation regularly as you plan and

    build your project. It keeps you in the habit and means you don’t have to go back and do it later. STYLE
  16. Don’t scope creep. Nobody likes lengthy spec documents. Break your

    documentation up so it lives at the deepest possible level. STYLE
  17. Do what you know. Use a simple text-based format that’s

    lightweight and flexible. Don’t make this hard. Do what you know. Markdown is pervasive and easy to learn. STRUCTURE
  18. Start with a README. A basic overview of your project,

    theme, or plugin. If you have nothing else, have this. STRUCTURE
  19. Have a LICENSE. Provide a LICENSE file that clearly delineates

    how your code can be used. For WordPress, it should be compatible with GPL v2 or higher. https://choosealicense.com/ STRUCTURE
  20. Help others CONTRIBUTE. A CONTRIBUTE file provides a home for

    information on patching, code review practices, and any other development specific criteria. STRUCTURE
  21. Writing Resources • Grammarly: Free Writing Assistant • Readable.io •

    Hemmingway Editor
 • Markdown Tutorial • Markdown Cheatsheet • StackEdit
  22. Have a canonical source. Decentralized documentation hurts. Don’t rely on

    scattered project artifacts or granular commit messages.
  23. Track changes over time. Keeping documentation in your version control

    system gives a clear picture as code and requirements evolve.
  24. Keep it with the code. The code is the only

    “artifact" that will exist for the full life of your project.
  25. Leverage pull requests. Key moments in the code history can

    provide more granular documentation. Use a template to add structure.
  26. Include project docs. You can use this model, with a

    
 /docs/ folder, to support full project documentation that will always live with your site.
  27. Generate a static site. Tools like MkDocs and Couscous create

    HTML documentation sites that get around the limitations of just Markdown.
  28. Host the HTML version. Web hosts like Read the Docs,

    GitHub Pages, and Netlify make it easy and free to create static documentation sites.
  29. Make it part of the workflow. Consistency is key. Enforce

    documentation creation as part of your development process.
  30. Something is better than nothing. Start small. If it is

    accurate, and kept up to date, it adds value.