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

Namegames: Solving the hardest parts of Computer Science

Andrew Hao
January 08, 2019

Namegames: Solving the hardest parts of Computer Science

The hardest problems in CS are in naming. Let's take a cue from communication studies and apply Semiotics to our software systems. Then we'll look at how DDD helps us develop modular software systems that are built to evolve with the business.

Andrew Hao

January 08, 2019
Tweet

More Decks by Andrew Hao

Other Decks in Programming

Transcript

  1. Namegames
    Cracking the hardest problems in computer
    science (seriously)
    Andrew Hao @andrewhao

    View Slide

  2. hi!

    View Slide

  3. “There are two hard things in
    computer science:


    naming,
    cache invalidation, and
    off-by-one errors”

    View Slide

  4. naming?

    View Slide

  5. (good) naming
    = readability
    = ⚒ high maintainability

    View Slide

  6. semiotics
    the study of signs and symbols

    View Slide

  7. “rose”

    View Slide

  8. Signifier
    “rose”
    Signified
    flower

    View Slide

  9. love
    passion
    romance
    connotation

    View Slide

  10. Signifier
    “rose”
    Signified
    love, passion,
    romance

    View Slide

  11. Signifier
    “rose”
    Signified
    ???
    Non-Western contexts?

    View Slide

  12. cultural
    contexts
    shape
    meaning

    View Slide

  13. software
    semiotics

    View Slide

  14. Signifier
    User
    Account
    Signified
    Registered site
    visitor
    Personal
    preferences

    View Slide

  15. cultural
    contexts
    shape
    meaning

    View Slide

  16. business
    contexts
    shape
    meaning

    View Slide

  17. Signifier
    User
    Account
    Signified
    Inbound visitor
    Email preferences
    Marketing context

    View Slide

  18. Signifier
    User
    Account
    Signified
    Credit card owner
    Credit card
    information
    Payment context

    View Slide

  19. Each business group has its own
    concepts
    vocabulary
    process(es)
    assumptions
    goals

    View Slide

  20. View Slide

  21. View Slide

  22. The invisible boundaries of culture &
    language

    View Slide

  23. We’re speaking different languages!

    View Slide

  24. Domain-driven
    naming

    View Slide

  25. View Slide

  26. View Slide

  27. View Slide

  28. View Slide

  29. Build a
    glossary

    View Slide

  30. A Glossary is a list of terms and
    definitions as thought about by the
    business

    View Slide

  31. View Slide

  32. It is built collaboratively through
    conversation, and continually updated

    View Slide

  33. Pay down
    software
    name debt

    View Slide

  34. Make a commitment to rename and
    refactor your systems according to
    your new language

    View Slide

  35. Build
    boundaries

    View Slide

  36. Build a software boundary (Bounded
    Context) around each business unit
    (Subdomain)

    View Slide

  37. View Slide

  38. Concepts & names can be precisely
    stated and free to evolve

    View Slide

  39. Getting to Alignment
    Business ↔ Domain Language ↔ Software

    View Slide

  40. A perfectly
    decent idea
    for naming

    View Slide

  41. Prefer
    Domain-Specific names
    over
    Flexibly Generic ones

    View Slide

  42. It’s not a… It’s a…
    AppointmentList Calendar
    Area SalesRegion
    Business Restaurant
    InvoiceManager BillingFlow

    View Slide

  43. How to
    manage
    change

    View Slide

  44. change: destroyer of systems

    View Slide

  45. the business pivots
    Old concepts need to be supported,
    but are no longer currently
    applicable.
    Draft up a plan to deprecate old
    classes, modules, concepts.

    View Slide

  46. another team joins the fray
    Not everyone has the same conceptual
    model; drift occurs in naming and
    concepts
    Consistently talk about naming in
    architecture meetings and code reviews

    View Slide

  47. an employee leaves
    She knows things about the system
    nobody else does
    Anticipate her departure and
    collaboratively update the glossary &
    other documentation

    View Slide

  48. In summary

    View Slide

  49. Applying semiotics to software
    Meaning in software systems is
    constructed through a business-
    cultural lens
    Therefore: view your system as a
    federation of cultures.
    Develop an independent, documented
    vocabulary for each business context.

    View Slide

  50. Align software to the business
    Clean systems map directly to business
    contexts
    Therefore: Update systems to cleanly
    use domain language.
    Modularize systems to independently
    operate in each business unit.

    View Slide

  51. Proactively manage change
    Change threatens to topple systems by
    introducing ambiguity
    Therefore: develop practices of
    updating documentation, sharing
    information and continually having
    conversations

    View Slide

  52. The summary
    of the
    summary

    View Slide

  53. See cultural
    boundaries

    Write it
    down

    Talk to business
    experts

    Change the
    code

    View Slide