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

The importance of naming

The importance of naming

In this talk, I walk through examples of bad naming, and derive my naming principles from them:

1. Use only one name to refer to a concept.
2. Give different concepts different names.
3. Rename concepts when principles are violated.
4. Ensure names match meaning.
5. Break up concepts that cannot be named properly.
6. Be consistently correct.

Denis Defreyne

February 06, 2020
Tweet

More Decks by Denis Defreyne

Other Decks in Technology

Transcript

  1. The importance


    of
    Denis Defreyne RUG
    :
    :
    B 2020
    -
    02
    -
    06
    naming

    View Slide

  2. principles
    cases +

    View Slide

  3. Inventory
    CASE 1

    View Slide

  4. moving inventory list

    View Slide

  5. moving inventory list
    Umzugsgutliste

    View Slide

  6. moving inventory list
    Umzugsgutliste moving goods list

    View Slide

  7. moving inventory list
    Umzugsgutliste moving goods list
    inventory of items

    View Slide

  8. Use only one name to refer to a thing.
    PRINCIPLE 1

    View Slide

  9. Use industry-standard names when possible.
    PRINCIPLE 1b

    View Slide

  10. Inventory, redux
    CASE 2

    View Slide

  11. moving inventory list
    Umzugsgutliste

    moving goods list

    inventory of items

    View Slide

  12. moving inventory list
    Umzugsgutliste
    
 (
    UGL
    )
    moving goods list

    inventory of items

    View Slide

  13. moving inventory list
    Umzugsgutliste
    
 (
    UGL
    )
    moving goods list
    
 (
    MGL
    )
    inventory of items

    View Slide

  14. moving inventory list
    Umzugsgutliste
    
 (
    UGL
    )
    moving goods list
    
 (
    MGL
    )
    inventory of items
    
 (
    IOI
    )

    View Slide

  15. moving inventory list
    Umzugsgutliste
    
 (
    UGL
    )
    moving goods list
    
 (
    MGL
    )
    inventory of items
    
 (
    IOI
    )

    View Slide

  16. glossary

    View Slide

  17. Give different things different names.
    PRINCIPLE 2

    View Slide

  18. Staging
    CASE 3

    View Slide

  19. 1 2 3 4 5
    stage

    View Slide

  20. 1 2 3 4 5
    stage 1

    5

    View Slide

  21. 1 2 3 4 5
    pipeline stages

    View Slide

  22. 1 2 3 4 5
    SalesForce stage

    View Slide

  23. 1 2 3 4 5
    SalesForce staging

    View Slide

  24. staging stage
    qa
    ??? ??? ???

    View Slide

  25. staging
    + sandboxes

    View Slide

  26. Rename things when principles are violated.
    PRINCIPLE 3

    View Slide

  27. Make renaming easy.
    PRINCIPLE 3b

    View Slide

  28. Leads
    CASE 4

    View Slide

  29. lead

    View Slide

  30. lead the contact information […]


    of a customer who is interested


    in a specific product or service.

    View Slide

  31. the

    outside

    world

    View Slide

  32. Lead
    Manager
    the

    outside

    world

    View Slide

  33. Lead
    Manager
    Core
    the

    outside

    world

    View Slide

  34. Lead
    Manager
    Core
    the

    outside

    world
    Salesforce

    View Slide

  35. Lead
    Manager
    Core
    the

    outside

    world
    Salesforce

    View Slide

  36. Lead
    Manager
    Core
    the

    outside

    world
    Salesforce
    manages leads

    View Slide

  37. Lead
    Manager
    Core
    the

    outside

    world
    Salesforce
    manages leads
    does not

    manage leads

    View Slide

  38. Ensure names match meaning.
    PRINCIPLE 4

    View Slide

  39. Leads, redux
    CASE 5

    View Slide

  40. Core

    View Slide

  41. Core
    leads
    id from_street to_street …

    View Slide

  42. Break up things that can’t be named properly.
    PRINCIPLE 5

    View Slide

  43. Importers and exporters
    CASE 6

    View Slide

  44. Core Salesforce

    View Slide

  45. Core Salesforce
    Importer
    Exporter

    View Slide

  46. Core Salesforce
    Exporter
    Importer

    View Slide

  47. Core Salesforce
    Importer
    Exporter

    View Slide

  48. Core
    Exporter
    Importer
    Exporter
    Exporter
    Importer
    Importer
    Exporter
    Importer

    View Slide

  49. Core
    Importer
    Exporter
    Importer
    Importer
    Exporter
    Exporter
    Importer
    Exporter

    View Slide

  50. Core
    Importer
    Exporter
    Importer
    Exporter
    Exporter
    Importer
    Importer
    Exporter

    View Slide

  51. Be consistently correct.
    PRINCIPLE 6

    View Slide

  52. 1 2 3 4 5 6

    View Slide

  53. Bonus round!
    CASE ∞

    View Slide

  54. Total price
    = total_price

    View Slide

  55. Total price
    = total_price +

    View Slide

  56. hercules hercules-ui

    View Slide

  57. hercules hercules-ui
    UI lives here

    View Slide

  58. UI

    View Slide

  59. UI api.company.de

    View Slide

  60. View Slide

  61. P1 Use only one name to refer to a thing.

    View Slide

  62. P1
    Give different things different names.

    View Slide

  63. P1
    Rename things when principles are violated.

    View Slide

  64. P1
    Ensure names match meaning.

    View Slide

  65. P1
    Break up things that can’t be named properly.

    View Slide

  66. P1
    Be consistently correct.

    View Slide

  67. 1 2 3 4 5 6 DONE

    View Slide

  68. DONE

    View Slide

  69. View Slide