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

Preventing Brain Freeze: Onboarding New Develop...

Preventing Brain Freeze: Onboarding New Developers with Living Documentation

Your first contribution to an existing in-house application can be like eating ice cream too quickly on a hot summer’s day – your excitement and enthusiasm result in a painful headache as you struggle to understand the domain and navigate the codebase. Elixir and the surrounding ecosystem have an excellent reputation for beautiful documentation and onboarding tools, but these practices don’t always migrate to in-house applications hidden from public view.

Together, we’ll discover the principles and practices of living documentation and how Elixir’s tooling supports its implementation. At the end of the presentation, you’ll leave with a set of techniques and methods to elevate your application’s onboarding experience to prevent the next ice cream headache.

Nicholas Henry

October 14, 2021
Tweet

More Decks by Nicholas Henry

Other Decks in Technology

Transcript

  1. - Reliabl e - Low Effor t - Collaborativ e

    - Insightful LIVING DOCUMENTATION
  2. "YOUR OUTCOMES ARE A LAGGING MEASURE OF YOUR HABITS. YOUR

    NET WORTH IS A LAGGING MEASURE OF YOUR FINANCIAL HABITS. YOUR WEIGHT IS A LAGGING MEASURE OF YOUR EATING HABITS. YOUR CLUTTER IS A LAGGING MEASURE OF YOUR CLEANING HABITS." JAMES CLEAR, ATOMIC HABITS
  3. "THE GUIDANCE OR PRESSURE THAT TEST-DRIVEN DEVELOPMENT PLACES ON YOUR

    SOFTWARE DESIGN" JB RAINSBERGER, INTEGRATED TESTS ARE A SCAM
  4. “…IS THE LITTLE VOICE IN THE BACK OF YOUR HEAD

    MADE MANIFEST BY A CRAPPY TEST WITH TOO MUCH SETUP" KELLY SUTTON
  5. "WRITING A README IS ABSOLUTELY ESSENTIAL TO WRITING GOOD SOFTWARE.

    UNTIL YOU’VE WRITTEN ABOUT YOUR SOFTWARE, YOU HAVE NO IDEA WHAT YOU’LL BE CODING." TOM PRESTON-WERNER
  6. "WRITE YOUR README FIRST. FIRST. AS IN, BEFORE YOU WRITE

    ANY CODE OR TESTS OR BEHAVIORS OR STORIES OR ANYTHING." TOM PRESTON-WERNER
  7. "A VERY SIMPLE BUT PARTICULARLY USEFUL TECHNIQUE FOR FINDING THE

    CAUSE OF A PROBLEM IS SIMPLY TO EXPLAIN IT TO SOMEONE ELSE. THE OTHER PERSON SHOULD LOOK OVER YOUR SHOULDER AT THE SCREEN, AND NOD HIS OR HER HEAD CONSTANTLY (LIKE A RUBBER DUCK BOBBING UP AND DOWN IN A BATHTUB). THEY DO NOT NEED TO SAY A WORD; THE SIMPLE ACT OF EXPLAINING, STEP BY STEP, WHAT THE CODE IS SUPPOSED TO DO OFTEN CAUSES THE PROBLEM TO LEAP OFF THE SCREEN AND ANNOUNCE ITSELF. ” THE PRAGMATIC PROGRAMMERS
  8. A STORY FROM THE FIELD A slew of warnings during

    doc generation reduces confidence in documentation
  9. ENDPOINT.EX plug Plug.Static, at: "/", from: :pockets_web, gzip: false, only:

    ~w(css fonts images js vendors favicon.ico robots.txt doc) 👀
  10. A STORY FROM THE FIELD Keep things that change together,

    close together, 
 including documentation
  11. -Time consumin g -Long single table of contents to navigat

    e -Single, global ex_doc con fi guration THE DOWNSIDES OF UMBRELLA DOCUMENTATION
  12. - Problem Domai n - Visio n - Stakeholder s

    - Business Capabilitie s - Solution Domai n - Catalog of Child Application s - Architecture UMBRELLA PROJECT README
  13. “A RATE OF RETURN (ROR) IS THE NET GAIN OR

    LOSS OF AN INVESTMENT OVER A SPECIFIED TIME PERIOD, EXPRESSED AS A PERCENTAGE OF THE INVESTMENT’S INITIAL COST. WHEN CALCULATING THE RATE OF RETURN, YOU ARE DETERMINING THE PERCENTAGE CHANGE FROM THE BEGINNING OF THE PERIOD UNTIL THE END.” INVESTOPEDIA
  14. RATE OF RETURN def calculate(current_value, initial_value) do current_value |> Decimal.sub(initial_value)

    |> Decimal.div(initial_value) |> Decimal.mult(100) end PROBLEM DOMAIN SOLUTION DOMAIN
  15. - Supplement with JavaScript librarie s - KaTeX: Math typesetting

    librar y - https://katex.org EXDOC + KATEX
  16. EXDOC CONFIGURATION defmodule FinancialRatios.MixProject do use Mix.Project def project do

    [ app: :financial_ratios, # … # Docs name: "Financial Ratios", homepage_url: "../index.html", docs: docs() ] end def docs, do: #… end defp docs do [ before_closing_head_tag: &before_closing_head_tag/1, output: "../../doc/financial_ratios" ] end defp before_closing_head_tag(_format), do: include_math_typsetting_lib() defp include_math_typsetting_lib do """ <link rel="stylesheet" href="https://cdn.jsdelivr.net/ <script defer src="https://cdn.jsdelivr.net/npm/katex <script defer src="https://cdn.jsdelivr.net/npm/katex """ end 👀 1 👀 2 👀 3
  17. defmodule FinancialRatios.RateOfReturn do @formula ~S| \text{Rate of return} = [\frac{(\text{Current

    value} - \text{Initial value})}{\text{Initial value}}]\times 100 | defstruct [:value] @moduledoc """ > A rate of return (RoR) is the net gain or loss of an investment over a specified time period, > expressed as a percentage of the investment’s initial cost. > > [Investopedia](https://www.investopedia.com/terms/r/rateofreturn.asp) The Formula for Rate of Return (RoR): $$#{@formula}$$ ## Example of a Rate of Return (RoR) > The rate of return can be calculated for any investment, dealing with any kind of asset. Let's > take the example of purchasing a home as a basic example for understanding how to calculate the > RoR. Say that you buy a house for $250,000 (for simplicity let's assume you pay 100% cash). iex> FinancialRatios.RateOfReturn.calculate(335_000, 250_000) #FinancialRatios.RateOfReturn<34.00%> """ # ... end 👀 1 👀 2 👀 3 👀 4
  18. - mix doc s - ExDoc HTM L - MathML

    rendered by KaTeX GENERATED DOCUMENTATION WITH KATEX
  19. “Custom runtimes: when executing Elixir code, you can either start

    a fresh Elixir instance, connect to an existing node, or run it inside an existing Elixir project, with access to all of its modules and dependencies.This means Livebook can be a great tool to provide live documentation for existing projects.” GUIDED TOUR 👀
  20. # install $ mix escript.install hex \ 
 livebook 0.2.3

    # start the server $ live server GUIDED TOUR 👀
  21. GUIDED TOUR $ live server - Start a node in

    the context of a Mix project 👀
  22. - Runtime to evaluate example s - Start a node

    in the context of a Mix project GUIDED TOUR 👀
  23. - Examples are evaluate d - Implement a tour for

    the complete applicatio n - KaTeX support out of the box GUIDED TOUR 👀
  24. - Small Experiment s - README-Driven Developmen t - ExDoc

    and C I - LiveBook for Complex Domains NEXT STEPS