SlideShare a Scribd company logo
@PeterHilton
http://hilton.org.uk/
Documentation avoidance
for developers
How to get away with less documentation 

and spend more time writing code
#WriteTheDocs
The documentation
problem
What are the
causes of
software
documentation?
@PeterHilton • 3
Justin Ennis / CC BY 2.0
‘M&Ms, 

managers and
meetings’
M&Ms generate demand for software documentation.
Meetings are failure demand.
http://www.happymelly.com/why-work-does-not-happen-at-work-the-mms/ @PeterHilton • 5
6@PeterHilton •
Michael Coghlan / CC BY-SA 2.0
Unfamiliar domains
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
JamesByrum/CCBY-ND2.0
Homer’s Iliad 

is now
legacy poetry
Developers 

look for
documentation
in legacy system
Jean-François
Millet
1857
Oil on canvasclassicprogrammerpaintings.com
Rob Smallshire - http://sixty-north.com/blog/predictive-models-of-development-teams-and-the-systems-they-build
dev tenure half life 3.1 years
code half-life 13 years
The documentation problem :(
There are many different causes of docs
(caused by different kinds of people)
Some programmers don’t love writing docs*
Programmers will leave your team
Writing good documentation is hard**
* but some do!
** but not as hard as programming, obviously 11@PeterHilton •
Tactics for avoiding the
need to write the docs
How far will you go?
You don’t have to write
docs if you leave your

mobile phone number 

in every source file. @PeterHilton • 13
@PeterHilton • 14
Constructive laziness
is when you’re lazy
about doing, but not
lazy about thinking.
@DenisHowlett
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
Documentation
avoidance applies
constructive laziness to
software documentation
@PeterHilton • 16
It’s on
the wiki!
Just-In-Time Documentation
1. Don’t write the docs.
2. Bluff, ‘it’s on the wiki’.
3. Still don’t write the docs.
4. If they come back, feign ignorance.
5. Then write it.
6. Later, casually mention that you ‘found it’.
18@PeterHilton •
goelshivi / PD
Alternatively, take time to
patiently explain your code
Reverse just-in-time (JIT) documentation
Instead of writing documentation in
advance, you can trick other people
into writing JIT documentation
by asking questions in a chat room
(and then pasting their answers into
the docs)
20@PeterHilton •
The handover delusion
A common management fallacy is
to assume that a developer who
never writes documentation can
somehow ‘write everything down’
before leaving the team.
21@PeterHilton •
Pair programming
Pair programming is far cheaper and
more effective than documentation
… but only if the other programmer is
(still) available.
22@PeterHilton •
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
‘A common fallacy is to assume authors
of incomprehensible code will somehow
be able to express themselves lucidly
and clearly in comments.’
@KevlinHenney
24@PeterHilton •
Acknowledge that writing docs is a specialist skill
On a cross-functional development team,
not everyone is good at visual design.
The same goes for writing about code.
Work out who is a better writer
… then get him or her to write the docs.
Maybe even hire a technical writer.
25@PeterHilton •
jameswragg / CC
// Calculates kitten cuteness.
Integer getCuteness()
// Returns a kitten ID.
String findKitten(String name)
// Check if kitten is alive.
if (airway && breathing &&
circulation)
/**
* @author Peter Hilton
*/
public class Kittens


Integer calculateCuteness()



KittenId findKitten(String name)

boolean alive = airway && 

breathing && circulation;

if (alive)



// Use version control!
/**
* Calculates cuteness in the range 0-10.
*
* Idempotent; does not modify the kittens.
*
* Reference Kitten (previous slide) defines cuteness score 10.
*
* Returns 0 for dead kittens (not cute).
*
* Throws NullKittenException if list contains a null kitten.
*
* Throws IllegalKittenException if list contains a non-kitten.
*/
Integer calculateAverageCuteness(List<Kitten> kittens)
Documentation avoidance
Constructive laziness
Just-in-time documentation
Pair programming
Getting someone else to write the docs
Code refactoring - especially better naming
Type safe programming
Unit tests - API usage example tests
29@PeterHilton •
Failing to get away with
documentation-avoidance
31@PeterHilton •
smlp.co.uk / CC BY 2.0
‘Just read the code’
‘It’s self-documenting’
What we talk about when we talk about code
Write the introduction:
purpose, scope, summary
Explain the design:
constraints, limitations, alternatives
Give examples
Add explanations for new team members
32@PeterHilton •
@PeterHilton •
Lesley Mair / CC BY 2.0
Why?
Even perfect code
cannot explain
why it exists
Explain the why
@PeterHilton • 34
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
Compromising on documentation-avoidance
Part of documentation avoidance is knowing
when you’re going to have to write docs anyway.
Then it’s about writing as little as possible…
36@PeterHilton •
Writing docs that aren’t
‘documentation’
There’s more than one kind of documentation
You can describe software in many ways:
more code, diagrams, chat, commits, docs.
Text isn’t necessary the hardest or most effort,
but keep it close to the code,
and don’t forget maintenance.
38@PeterHilton •
Code comments
Programmers get weird about code comments…
Comments are often a taboo subject
… but a feature of every programming language
Comments are just another documentation tool
… and not the worst way to write documentation
Comments are closer to the code than other docs.
39@PeterHilton •
Capitalized, short (50 chars or less) summary
More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
or "Fixes bug." This convention matches up with commit messages generated
by commands like git merge and git revert.
Further paragraphs come after blank lines.
- Bullet points are okay, too
- Typically a hyphen or asterisk is used for the bullet, followed by a
single space, with blank lines in between, but conventions vary here
http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
Commit messages (instead of comments)
Write a short subject line.
Add additional paragraphs to explain:
why a change was necessary,
how the change addresses the issue,
what changed,
why you made the change the way you did,
consequences of the change
41@PeterHilton •
README-Driven Development
‘… we have projects with short, badly written,
or entirely missing documentation…
There must be some middle ground between
reams of technical specifications and no
specifications at all. And in fact there is.
That middle ground is the humble Readme.’
http://tom.preston-werner.com/2010/08/23/readme-driven-development.html 42@PeterHilton •
Today I Learned
(TIL)
Short independent
articles that each
document one thing.
Markdown files in a
GitHub repository.
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
Tutorials, instructions & other written forms
45@PeterHilton •
Something you’re working on doesn’t have docs.
A solution to a specific problem is useful for someone.
The only tutorial on a topic can get a lot of page views.
You might even get a little bit famous in a community.
Publish on a blog, on Stack Overflow or in a TIL repository.
46@PeterHilton •
Voxxed Days Thessaloniki 2016 - Documentation Avoidance
Public API docs
The best API docs are written by hand (tools are for layout).
Structure and consistency are crucial.
API docs generators solve structure and layout - 

a less interesting problem - and don’t write docs for you
Java/Scaladoc, Swagger, Silk, Spring REST Docs
48@PeterHilton •
Chat rooms
Team chat is essential for development teams
… and we’ve come a long way since IRC
Chat can replace some documentation if search is good
(search is why it’s worth paying for Slack)
Cheaper alternatives include:
HipChat, Gitter
Lack of search is why you don’t use Skype for group chat
49@PeterHilton •
Wikis & other tools for talking code
Despite the alternatives, you usually still need a document-
based system for internal software documentation.
:) Wikis replaced Microsoft Word docs on shared drives.
:( Wiki software has been stagnant for a decade.
Confluence turned into something else.
Modern alternatives are closed platforms.
GitHub Wiki might be as good as it gets.
50@PeterHilton •
/**
* Calculates cuteness in the range 0-10.
*
* Idempotent; does not modify the kittens.
*
* Reference Kitten (previous slide) defines cuteness score 10.
*
* Returns 0 for dead kittens (not cute).
*
* Throws NullKittenException if list contains a null kitten.
*
* Throws IllegalKittenException if list contains a non-kitten.
*/
Integer calculateAverageCuteness(List<Kitten> kitten)
Enrico / CC BY 2.0
53@PeterHilton •
Erich Ferdinand / CC BY 2.0
http://www.j-paine.org/dobbs/prolog_lightbulb.html
?- How many Prolog programmers does it take 

to change a lightbulb?

false
Take-aways: tools, tips &
practical techniques
Write a project/project introduction
Write an introduction (README) for your software:
Explain the purpose and scope
Summarise what it does.
Write installation and development instructions.
Publish tutorials online.
Don’t forget to write (good) code comments.
57@PeterHilton •
Write good code comments
Try to write good code first (and tests!).
Try to write a one-sentence comment.
Refactor the code (make it easier).
Delete unnecessary comments (just like unused code).
Rewrite bad comments
(all good writing requires rewriting)
Add detail where needed.
58@PeterHilton •
Comments
are not the enemy.
Meetings
are the enemy!
@PeterHilton • 59
Write detailed installation/test instructions
Detailed instructions make every keystroke/click explicit.
‘On the process start form, in the Answer field, enter 42.’
Surprisingly easy to write.
Surprisingly valuable (in time that readers save).
Automate installation/testing where you can
… and write procedures for what’s left.
60@PeterHilton •
Understand who and what the docs are for
‘There should be documentation’ isn’t enough.
Work out who needs the docs:
your future self, other developers, users, 

managers & other stakeholders.
Use documentation to reduce costs,
e.g. installation effort or team handover.
61@PeterHilton •
Aim to write the
Minimum Viable
Documentation.
The rest is waste.
@PeterHilton • 62
Specifications
Some complex systems require documentation for a
specific area that is hard to understand
Architecture diagram
UML diagram
Data dictionary
Process model
Business rules
63@PeterHilton •
Choose the right kind of docs
README
Installation instructions (step-by-step)
Code comments
TIL (Today I Learned)
Tutorials
API documentation
Specifications (rarely)
Presentations :) 64@PeterHilton •
Use Markdown or similar
Things that seemed like a good idea at the time:
troff, SGML, RTF, DocBook, XHTML, XSL-FO
Things that seem like a better idea now:
Markdown, reStructuredText, AsciiDoc
The ultimate text markup language is still:
HTML
65@PeterHilton •
Use humour
There’s no rule that says that jokes aren’t allowed.
Insufficiently serious documentation is probably
not your biggest problem. Staying awake might be.
Humour isn’t magic.
There are several practical theories of what’s funny.
66@PeterHilton •
Choose an appropriate tool that you like
GitHub repo - plain Markdown files
GitHub Pages - Jekyll site builder
GitHub Wiki - Gollum wiki
Read the Docs - Sphinx docs builder
Asciidoctor - asciidoc to many formats
Swagger - API docs structure and layout
Silk - API docs
67@PeterHilton •
M A N N I N G
Peter Hilton
Erik Bakker
Francisco Canedo
FOREWORD BY James Ward
Covers Play 2
Play for Scala

(Manning, 2014)


Peter Hilton

Erik Bakker

Francisco Canedo
http://bit.ly/playscala2p
Summary
Summary
Writing documentation sucks;
… but has value and isn’t going away
You need documentation,
… but not very much of it
Many developers hate writing it,
… but not all of them
You hardly have to write any;
… you might find someone else to write the rest 70@PeterHilton •
@PeterHilton
http://hilton.org.uk/ #WriteTheDocs

More Related Content

PDF
Documentation avoidance for developers
PDF
Meeting-avoidance for self-managing developers
PPTX
Creating and Maintaining an Open Source Library
PDF
Introduction to License Compliance and My research (D. German)
PDF
Scale14x Patterns and Practices for Open Source Project Success
PDF
The Software Developer’s Guide to Open Source Hardware
ODP
Levelling up in open source
PPTX
How to get started in Open Source!
Documentation avoidance for developers
Meeting-avoidance for self-managing developers
Creating and Maintaining an Open Source Library
Introduction to License Compliance and My research (D. German)
Scale14x Patterns and Practices for Open Source Project Success
The Software Developer’s Guide to Open Source Hardware
Levelling up in open source
How to get started in Open Source!

Viewers also liked (9)

PDF
James Cropper Specialty papers unique experience producing luxury boards with...
PPTX
Mule Script Transformer
PDF
Using Benchmark Data to Improve Performance
PPTX
Mule chapter2
PPTX
Mule Expression Transformer
PPTX
Combined analysis of Watson and Spark
PDF
Creating A Digital Content Factory: Getting Started with Intelligent Content
PPTX
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
PPTX
Security and Data Governance using Apache Ranger and Apache Atlas
James Cropper Specialty papers unique experience producing luxury boards with...
Mule Script Transformer
Using Benchmark Data to Improve Performance
Mule chapter2
Mule Expression Transformer
Combined analysis of Watson and Spark
Creating A Digital Content Factory: Getting Started with Intelligent Content
Continuous Delivery concept overview. Continuous Integration Systems. DevOps ...
Security and Data Governance using Apache Ranger and Apache Atlas
Ad

Similar to Voxxed Days Thessaloniki 2016 - Documentation Avoidance (20)

PDF
How to write good comments
ODP
Documenting code yapceu2016
ODP
Documenting Code - Patterns and Anti-patterns - NLPW 2016
PPTX
30% faster coder on-boarding when you have a code cookbook
PDF
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017
PDF
How to write maintainable code
PPTX
What they don't teach you in CS departments
PDF
Culture And Aesthetic Revisited
PDF
Writing code for people
PDF
How to write good quality code
PPTX
API Workshop: Deep dive into code samples
PPTX
Growing Developer Community One Pull Request At a Time
PDF
Write code and find a job
PDF
IT Systems for Knowledge Management used in Software Engineering (2010)
PPT
FSOSS - Enter the 4th Dimension: Documentation
PDF
The journey to become a solid developer
PDF
Living documentation
PDF
Collaborating on GitHub for Open Source Documentation
PDF
Documentation: get it right! (ApacheCon EU 2009)
KEY
Write a better FM
How to write good comments
Documenting code yapceu2016
Documenting Code - Patterns and Anti-patterns - NLPW 2016
30% faster coder on-boarding when you have a code cookbook
How to write maintainable code - Peter Hilton - Codemotion Amsterdam 2017
How to write maintainable code
What they don't teach you in CS departments
Culture And Aesthetic Revisited
Writing code for people
How to write good quality code
API Workshop: Deep dive into code samples
Growing Developer Community One Pull Request At a Time
Write code and find a job
IT Systems for Knowledge Management used in Software Engineering (2010)
FSOSS - Enter the 4th Dimension: Documentation
The journey to become a solid developer
Living documentation
Collaborating on GitHub for Open Source Documentation
Documentation: get it right! (ApacheCon EU 2009)
Write a better FM
Ad

More from Voxxed Days Thessaloniki (13)

PPTX
Voxxed Days Thesaloniki 2016 - The Long Road
PDF
Voxxed Days Thesaloniki 2016 - Scaling react.js applications
PDF
Voxxed Days Thesaloniki 2016 - Herding cats to a firefight
PDF
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
PDF
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
PDF
Voxxed Days Thesaloniki 2016 - Rightsize Your Services with WildFly & WildFly...
PDF
Voxxed Days Thessaloniki 2016 - Microservices in production
PDF
Voxxed Days Thesaloniki 2016 - Whirlwind tour through the HTTP2 spec
PDF
Voxxed Days Thesaloniki 2016 - Machine Learning for Developers
PDF
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...
PDF
Voxxed Days Thesaloniki 2016 - 5 must have patterns for your web-scale micros...
PDF
Voxxed Days Thesaloniki 2016 - A journey to Open Source Technologies on Azure
PDF
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...
Voxxed Days Thesaloniki 2016 - The Long Road
Voxxed Days Thesaloniki 2016 - Scaling react.js applications
Voxxed Days Thesaloniki 2016 - Herding cats to a firefight
Voxxed Days Thessaloniki 2016 - Web assembly : the browser vm we were waiting...
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Rightsize Your Services with WildFly & WildFly...
Voxxed Days Thessaloniki 2016 - Microservices in production
Voxxed Days Thesaloniki 2016 - Whirlwind tour through the HTTP2 spec
Voxxed Days Thesaloniki 2016 - Machine Learning for Developers
Voxxed Days Thessaloniki 2016 - Continuous Delivery: Jenkins, Docker and Spri...
Voxxed Days Thesaloniki 2016 - 5 must have patterns for your web-scale micros...
Voxxed Days Thesaloniki 2016 - A journey to Open Source Technologies on Azure
Voxxed Days Thessaloniki 2016 - Keynote - JDK 9 : Big Changes To Make Java Sm...

Recently uploaded (20)

PPTX
Transform Your Business with a Software ERP System
PPTX
ai tools demonstartion for schools and inter college
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PDF
System and Network Administration Chapter 2
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
history of c programming in notes for students .pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Nekopoi APK 2025 free lastest update
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Understanding Forklifts - TECH EHS Solution
PDF
medical staffing services at VALiNTRY
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Transform Your Business with a Software ERP System
ai tools demonstartion for schools and inter college
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
System and Network Administration Chapter 2
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Design an Analysis of Algorithms I-SECS-1021-03
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
history of c programming in notes for students .pptx
PTS Company Brochure 2025 (1).pdf.......
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
How Creative Agencies Leverage Project Management Software.pdf
Online Work Permit System for Fast Permit Processing
Nekopoi APK 2025 free lastest update
Softaken Excel to vCard Converter Software.pdf
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Navsoft: AI-Powered Business Solutions & Custom Software Development
Upgrade and Innovation Strategies for SAP ERP Customers
Understanding Forklifts - TECH EHS Solution
medical staffing services at VALiNTRY
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

Voxxed Days Thessaloniki 2016 - Documentation Avoidance

  • 1. @PeterHilton http://hilton.org.uk/ Documentation avoidance for developers How to get away with less documentation 
 and spend more time writing code #WriteTheDocs
  • 3. What are the causes of software documentation? @PeterHilton • 3
  • 4. Justin Ennis / CC BY 2.0
  • 5. ‘M&Ms, 
 managers and meetings’ M&Ms generate demand for software documentation. Meetings are failure demand. http://www.happymelly.com/why-work-does-not-happen-at-work-the-mms/ @PeterHilton • 5
  • 6. 6@PeterHilton • Michael Coghlan / CC BY-SA 2.0 Unfamiliar domains
  • 9. Developers 
 look for documentation in legacy system Jean-François Millet 1857 Oil on canvasclassicprogrammerpaintings.com
  • 10. Rob Smallshire - http://sixty-north.com/blog/predictive-models-of-development-teams-and-the-systems-they-build dev tenure half life 3.1 years code half-life 13 years
  • 11. The documentation problem :( There are many different causes of docs (caused by different kinds of people) Some programmers don’t love writing docs* Programmers will leave your team Writing good documentation is hard** * but some do! ** but not as hard as programming, obviously 11@PeterHilton •
  • 12. Tactics for avoiding the need to write the docs
  • 13. How far will you go? You don’t have to write docs if you leave your
 mobile phone number 
 in every source file. @PeterHilton • 13
  • 14. @PeterHilton • 14 Constructive laziness is when you’re lazy about doing, but not lazy about thinking. @DenisHowlett
  • 16. Documentation avoidance applies constructive laziness to software documentation @PeterHilton • 16
  • 18. Just-In-Time Documentation 1. Don’t write the docs. 2. Bluff, ‘it’s on the wiki’. 3. Still don’t write the docs. 4. If they come back, feign ignorance. 5. Then write it. 6. Later, casually mention that you ‘found it’. 18@PeterHilton •
  • 19. goelshivi / PD Alternatively, take time to patiently explain your code
  • 20. Reverse just-in-time (JIT) documentation Instead of writing documentation in advance, you can trick other people into writing JIT documentation by asking questions in a chat room (and then pasting their answers into the docs) 20@PeterHilton •
  • 21. The handover delusion A common management fallacy is to assume that a developer who never writes documentation can somehow ‘write everything down’ before leaving the team. 21@PeterHilton •
  • 22. Pair programming Pair programming is far cheaper and more effective than documentation … but only if the other programmer is (still) available. 22@PeterHilton •
  • 24. ‘A common fallacy is to assume authors of incomprehensible code will somehow be able to express themselves lucidly and clearly in comments.’ @KevlinHenney 24@PeterHilton •
  • 25. Acknowledge that writing docs is a specialist skill On a cross-functional development team, not everyone is good at visual design. The same goes for writing about code. Work out who is a better writer … then get him or her to write the docs. Maybe even hire a technical writer. 25@PeterHilton •
  • 27. // Calculates kitten cuteness. Integer getCuteness() // Returns a kitten ID. String findKitten(String name) // Check if kitten is alive. if (airway && breathing && circulation) /** * @author Peter Hilton */ public class Kittens 
 Integer calculateCuteness()
 
 KittenId findKitten(String name)
 boolean alive = airway && 
 breathing && circulation;
 if (alive)
 
 // Use version control!
  • 28. /** * Calculates cuteness in the range 0-10. * * Idempotent; does not modify the kittens. * * Reference Kitten (previous slide) defines cuteness score 10. * * Returns 0 for dead kittens (not cute). * * Throws NullKittenException if list contains a null kitten. * * Throws IllegalKittenException if list contains a non-kitten. */ Integer calculateAverageCuteness(List<Kitten> kittens)
  • 29. Documentation avoidance Constructive laziness Just-in-time documentation Pair programming Getting someone else to write the docs Code refactoring - especially better naming Type safe programming Unit tests - API usage example tests 29@PeterHilton •
  • 30. Failing to get away with documentation-avoidance
  • 31. 31@PeterHilton • smlp.co.uk / CC BY 2.0 ‘Just read the code’ ‘It’s self-documenting’
  • 32. What we talk about when we talk about code Write the introduction: purpose, scope, summary Explain the design: constraints, limitations, alternatives Give examples Add explanations for new team members 32@PeterHilton •
  • 33. @PeterHilton • Lesley Mair / CC BY 2.0 Why?
  • 34. Even perfect code cannot explain why it exists Explain the why @PeterHilton • 34
  • 36. Compromising on documentation-avoidance Part of documentation avoidance is knowing when you’re going to have to write docs anyway. Then it’s about writing as little as possible… 36@PeterHilton •
  • 37. Writing docs that aren’t ‘documentation’
  • 38. There’s more than one kind of documentation You can describe software in many ways: more code, diagrams, chat, commits, docs. Text isn’t necessary the hardest or most effort, but keep it close to the code, and don’t forget maintenance. 38@PeterHilton •
  • 39. Code comments Programmers get weird about code comments… Comments are often a taboo subject … but a feature of every programming language Comments are just another documentation tool … and not the worst way to write documentation Comments are closer to the code than other docs. 39@PeterHilton •
  • 40. Capitalized, short (50 chars or less) summary More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. In some contexts, the first line is treated as the subject of an email and the rest of the text as the body. The blank line separating the summary from the body is critical (unless you omit the body entirely); tools like rebase can get confused if you run the two together. Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." This convention matches up with commit messages generated by commands like git merge and git revert. Further paragraphs come after blank lines. - Bullet points are okay, too - Typically a hyphen or asterisk is used for the bullet, followed by a single space, with blank lines in between, but conventions vary here http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
  • 41. Commit messages (instead of comments) Write a short subject line. Add additional paragraphs to explain: why a change was necessary, how the change addresses the issue, what changed, why you made the change the way you did, consequences of the change 41@PeterHilton •
  • 42. README-Driven Development ‘… we have projects with short, badly written, or entirely missing documentation… There must be some middle ground between reams of technical specifications and no specifications at all. And in fact there is. That middle ground is the humble Readme.’ http://tom.preston-werner.com/2010/08/23/readme-driven-development.html 42@PeterHilton •
  • 43. Today I Learned (TIL) Short independent articles that each document one thing. Markdown files in a GitHub repository.
  • 45. Tutorials, instructions & other written forms 45@PeterHilton • Something you’re working on doesn’t have docs. A solution to a specific problem is useful for someone. The only tutorial on a topic can get a lot of page views. You might even get a little bit famous in a community. Publish on a blog, on Stack Overflow or in a TIL repository.
  • 48. Public API docs The best API docs are written by hand (tools are for layout). Structure and consistency are crucial. API docs generators solve structure and layout - 
 a less interesting problem - and don’t write docs for you Java/Scaladoc, Swagger, Silk, Spring REST Docs 48@PeterHilton •
  • 49. Chat rooms Team chat is essential for development teams … and we’ve come a long way since IRC Chat can replace some documentation if search is good (search is why it’s worth paying for Slack) Cheaper alternatives include: HipChat, Gitter Lack of search is why you don’t use Skype for group chat 49@PeterHilton •
  • 50. Wikis & other tools for talking code Despite the alternatives, you usually still need a document- based system for internal software documentation. :) Wikis replaced Microsoft Word docs on shared drives. :( Wiki software has been stagnant for a decade. Confluence turned into something else. Modern alternatives are closed platforms. GitHub Wiki might be as good as it gets. 50@PeterHilton •
  • 51. /** * Calculates cuteness in the range 0-10. * * Idempotent; does not modify the kittens. * * Reference Kitten (previous slide) defines cuteness score 10. * * Returns 0 for dead kittens (not cute). * * Throws NullKittenException if list contains a null kitten. * * Throws IllegalKittenException if list contains a non-kitten. */ Integer calculateAverageCuteness(List<Kitten> kitten)
  • 52. Enrico / CC BY 2.0
  • 55. ?- How many Prolog programmers does it take 
 to change a lightbulb?
 false
  • 56. Take-aways: tools, tips & practical techniques
  • 57. Write a project/project introduction Write an introduction (README) for your software: Explain the purpose and scope Summarise what it does. Write installation and development instructions. Publish tutorials online. Don’t forget to write (good) code comments. 57@PeterHilton •
  • 58. Write good code comments Try to write good code first (and tests!). Try to write a one-sentence comment. Refactor the code (make it easier). Delete unnecessary comments (just like unused code). Rewrite bad comments (all good writing requires rewriting) Add detail where needed. 58@PeterHilton •
  • 59. Comments are not the enemy. Meetings are the enemy! @PeterHilton • 59
  • 60. Write detailed installation/test instructions Detailed instructions make every keystroke/click explicit. ‘On the process start form, in the Answer field, enter 42.’ Surprisingly easy to write. Surprisingly valuable (in time that readers save). Automate installation/testing where you can … and write procedures for what’s left. 60@PeterHilton •
  • 61. Understand who and what the docs are for ‘There should be documentation’ isn’t enough. Work out who needs the docs: your future self, other developers, users, 
 managers & other stakeholders. Use documentation to reduce costs, e.g. installation effort or team handover. 61@PeterHilton •
  • 62. Aim to write the Minimum Viable Documentation. The rest is waste. @PeterHilton • 62
  • 63. Specifications Some complex systems require documentation for a specific area that is hard to understand Architecture diagram UML diagram Data dictionary Process model Business rules 63@PeterHilton •
  • 64. Choose the right kind of docs README Installation instructions (step-by-step) Code comments TIL (Today I Learned) Tutorials API documentation Specifications (rarely) Presentations :) 64@PeterHilton •
  • 65. Use Markdown or similar Things that seemed like a good idea at the time: troff, SGML, RTF, DocBook, XHTML, XSL-FO Things that seem like a better idea now: Markdown, reStructuredText, AsciiDoc The ultimate text markup language is still: HTML 65@PeterHilton •
  • 66. Use humour There’s no rule that says that jokes aren’t allowed. Insufficiently serious documentation is probably not your biggest problem. Staying awake might be. Humour isn’t magic. There are several practical theories of what’s funny. 66@PeterHilton •
  • 67. Choose an appropriate tool that you like GitHub repo - plain Markdown files GitHub Pages - Jekyll site builder GitHub Wiki - Gollum wiki Read the Docs - Sphinx docs builder Asciidoctor - asciidoc to many formats Swagger - API docs structure and layout Silk - API docs 67@PeterHilton •
  • 68. M A N N I N G Peter Hilton Erik Bakker Francisco Canedo FOREWORD BY James Ward Covers Play 2 Play for Scala
 (Manning, 2014) 
 Peter Hilton
 Erik Bakker
 Francisco Canedo http://bit.ly/playscala2p
  • 70. Summary Writing documentation sucks; … but has value and isn’t going away You need documentation, … but not very much of it Many developers hate writing it, … but not all of them You hardly have to write any; … you might find someone else to write the rest 70@PeterHilton •