Documentation for developers: A gift to your future self

A presentation at Drupal GovCon 2024 in August 2024 in College Park, MD, USA by Kurt Trowbridge

Slide 1

Slide 1

Documentation for developers A gift to your future self Kurt Trowbridge Front-End Development Team Leader Gravity Works Design + Development

Slide 2

Slide 2

2

Slide 3

Slide 3

Content types · Nodes · Fields · Taxonomy vocabularies Display settings · Templates · Image styles · User roles Permissions · Views · Blocks · Modules · Plugins · Hooks Workflows · Composer · Drush · Caching 3

Slide 4

Slide 4

Content types · Nodes · Fields · Taxonomy vocabularies Display settings · Templates · Image styles · User roles Permissions · Views · Blocks · Modules · Plugins · Hooks Workflows · Composer · Drush · Caching · Semantic HTML Responsive design · CSS · Preprocessors · Modern JavaScript Atomic Design · Accessibility · Performance · Typography Build tools · DNS · Server management · Security · Git · CI/CD 3

Slide 5

Slide 5

Content types · Nodes · Fields · Taxonomy vocabularies Display settings · Templates · Image styles · User roles Permissions · Views · Blocks · Modules · Plugins · Hooks Workflows · Composer · Drush · Caching · Semantic HTML Responsive design · CSS · Preprocessors · Modern JavaScript Atomic Design · Accessibility · Performance · Typography Build tools · DNS · Server management · Security · Git · CI/CD Task management · Meetings · Collaboration · Deadlines Customer service · Understanding requirements · Email Scope creep · Professional development · Work/life balance… 3

Slide 6

Slide 6

Content types · Nodes · Fields · Taxonomy vocabularies Display settings · Templates · Image styles · User roles Permissions · Views · Blocks · Modules · Plugins · Hooks Workflows · Composer · Drush · Caching · Semantic HTML Responsive design · CSS · Preprocessors · Modern JavaScript Atomic Design · Accessibility · Performance · Typography Build tools · DNS · Server management · Security · Git · CI/CD Task management · Meetings · Collaboration · Deadlines Customer service · Understanding requirements · Email Scope creep · Professional development · Work/life balance… 3

Slide 7

Slide 7

There’s a lot to learn.

Slide 8

Slide 8

5

Slide 9

Slide 9

6

Slide 10

Slide 10

Slide 11

Slide 11

Documentation benefits… 01 02 03 You, now Your team You, in the future 8

Slide 12

Slide 12

Preparing & planning Managing the messy middle Unlocking future potential Effective > efficient 9

Slide 13

Slide 13

5174812218 10

Slide 14

Slide 14

Your memory is an unreliable narrator. 11

Slide 15

Slide 15

Component planning Brad Frost 12

Slide 16

Slide 16

Documenting your content model Drupal Spec Tool 13

Slide 17

Slide 17

Development task planning (1/2) Make your title actionable—start with a ver Identify a problem, and make the title the solutio Include descriptions when context is neede Don’t be afraid to rename tasks or update descriptions later 14

Slide 18

Slide 18

Development task planning (2/2) 15

Slide 19

Slide 19

Documentation is the act of thinking and then putting those thoughts on paper. 16

Slide 20

Slide 20

Even if you’ve already decided on the next step you’ll take to resolve a problem, your mind can’t let go until and unless you park a reminder in a place it knows you will, without fail, look. It will keep pressuring you about that untaken next step, usually when you can’t do anything about it, which will just add to your stress. —David Allen, Getting Things Done 17

Slide 21

Slide 21

Preparing & planning Managing the messy middle Unlocking future potential Effective > efficient 18

Slide 22

Slide 22

Miller’s Law The immediate memory span of people is limited to approximately seven items, plus or minus two. 19

Slide 23

Slide 23

?????????? 20

Slide 24

Slide 24

(517) 481-2218 21

Slide 25

Slide 25

Benefits of chunking Breaks down large tasks into smaller, more manageable piece Makes it easier to make progress between meetings and in spare tim Reduces cognitive overhea Enables delegation and faster feedback Eugenia Hauss Chunking also prevents this. 22

Slide 26

Slide 26

Fog of uncertainty

Slide 27

Slide 27

Know your audience Document where the right people are going to see i Tailor information to what that audience need Don’t assume—avoid words like “just” and “simply Use visuals and external links for additional context 24

Slide 28

Slide 28

Documenting code with comments Good documentation is selfdescriptive, but include business logic where neede Use chunking to think through the code before you write i Leave URLs as breadcrumbs to inspiration or earlier thinking 25

Slide 29

Slide 29

Development parallels Write “escape hatches” like you would an early return—let someone stop reading if it’s not relevant to the Think of task templates like you would a repeatable functio Documentation-driven development: use comments to help you plan your code 26

Slide 30

Slide 30

Naming things is hard…or is it? Be clear, not clever Use action-based variables (“getRoles,” “saveToken,” “prepareData” Name state functions clearly, also starting with verbs (“isOpen,” “hasProfilePicture” Mindset: keep functions small, then name them according to that function 27

Slide 31

Slide 31

Architecture Decision Records (ADRs) Document “invisible standards” that are expected, but not yet written dow Include context about why the decision was mad Should exist for the long term, but can change as technology evolves 28

Slide 32

Slide 32

Taking notes in meetings Yes, developers should take notes too Note important information, decisions, and next steps—don’t transcribe the full conversatio Use document templates for easy prep Emojis help highlight next steps during a meeting. 29

Slide 33

Slide 33

Checking out Before you wrap up on a task and switch to something else, take note of where you’re leaving o Helps project managers stay in the loo Reduces effort needed to spin back up next time 30

Slide 34

Slide 34

Retrieving information from memory storage and bringing it into the focus of awareness, comparing information, evaluating, deciding—all make demands on the mind’s limited processing capacity. —Mihaly Csikszentmihalyi, Flow 31

Slide 35

Slide 35

Preparing & planning Managing the messy middle Unlocking future potential Effective > efficient 32

Slide 36

Slide 36

Using docs to power AI tools NotebookLM (Google) 33 Notion AI

Slide 37

Slide 37

Speech-to-text AI apps can help with meeting transcriptions, so you can focus on documenting decisions, business rules, and next steps. 34

Slide 38

Slide 38

Documentation is a team sport. 35

Slide 39

Slide 39

Shifting left—why not documentation? 01 Testing 02 Security 03 Accessibility 36 04 …Documentation?

Slide 40

Slide 40

Who on the team actually makes working software? Only the engineers. Every other role is largely one of documentation. —Dan Mall, Design That Scales 37

Slide 41

Slide 41

Collective knowledge strategies 01 Write as you learn 02 Rubber-duck 03 Work in public 38 04 Answer questions with a link

Slide 42

Slide 42

Collective knowledge provides resilience against: 01 02 03 Vacations Sick days Employee turnover 39

Slide 43

Slide 43

Preparing & planning Managing the messy middle Unlocking future potential Effective > efficient 40

Slide 44

Slide 44

“Year of Efficiency”

Slide 45

Slide 45

Efficient teams: Effective teams: Adopt the mantra “move fast Build with purpose and and break things intentio Value urgency over relevanc Value relevancy over urgenc Work in unstable Make time to build processes environments prone to errors and practices that establish and mistakes stability 42

Slide 46

Slide 46

Being effective means getting good at the thinking and problem-solving that AI can’t do for you.
 Documentation helps speed up that process. 43

Slide 47

Slide 47

How to make documentation happen 01 Build it into your culture 02 Do it little by little 03 Make it everyone’s responsibility 44 04 Tend to your garden

Slide 48

Slide 48

Make documentation part of your definition of “done.” 45

Slide 49

Slide 49

Thank you!

Slide 50

Slide 50