Slide 1

Slide 1 text

2019 DevDay Clean Code Through Understanding and Communication > Luke Carwardine > LINE App Dev Team7 Software Engineer

Slide 2

Slide 2 text

Introduction > Messy code can be a symptom of poor business design or requirements > Clean code is often thought of as coding principles and patterns

Slide 3

Slide 3 text

Introduction > Poor design and requirements can come about through misunderstanding: > of the problem > how the problem should be solved > through the language

Slide 4

Slide 4 text

Example > Why would a sofa be a car? > What were the requirements? > What was the problem that was being solved?

Slide 5

Slide 5 text

"It's What the Business Wanted" > Business direction may have dramatically changed > Developer must help guide design and requirements > "The business" doesn't understand the code base

Slide 6

Slide 6 text

Understanding the Issues > Don't assume the given proposal/design/requirement/ solution is correct > What is the original problem?

Slide 7

Slide 7 text

Addressing the Issues Roles and Responsibilities > Make sure stakeholders know who is responsible for what > Introduce all stakeholders into the process as early as possible

Slide 8

Slide 8 text

Addressing the Issues Roles and Responsibilities > If no one wants to take responsibility, take control (and inform others) > Raise issues early to avoid fixed business plans

Slide 9

Slide 9 text

Scenario 1 Odd Business Requirements > The business has made decisions that are fixed and cannot be changed > Lack of stakeholder input > Lack of people wanting to take responsibility > Code base does not reflect new direction of the business

Slide 10

Slide 10 text

Scenario 1 Odd Business Requirements > Requirement > Sales system must support sales of both sofas and cars > Problem with current solution > While Sofas and cars have similar properties, a car isn't a logical extension of a sofa. > Scenario > The business has decided to sell cars in addition to sofas as they share similar characteristics (number of seats and color)

Slide 11

Slide 11 text

Scenario 1 > Future items can have different properties > Adjusted requirement > Sales system must support sales of new types of items Improved Solution

Slide 12

Slide 12 text

Addressing the Issues Discussion > Take language differences into consideration > Keep communication channels open

Slide 13

Slide 13 text

Addressing the Issues Discussion > Ask "obvious" questions to ensure everyone is on the same page > Ask questions early > If you don't understand, make sure to ask!

Slide 14

Slide 14 text

Scenario 2 Lost in Translation > Language used in requirements/business does not match language used in code base > This can be both > natural language translations (e.g. Japanese ⬄ English) > business language that is non-obvious (i.e. jargon)

Slide 15

Slide 15 text

Scenario 2 Lost in Translation > Requirement > Must add if sofa "is a car" > Problem with current solution > Language in code base does not match natural/business language > Scenario > Wheels are being added to sofas. Object + wheels = car in "fictional language".

Slide 16

Slide 16 text

Scenario 2 > Language in code now reflects natural language > Adjusted requirement > Must add if sofa "has wheels" Improved Solution (Translation)

Slide 17

Slide 17 text

Scenario 2 > Business language is now explained to those unfamiliar with the jargon > Adjusted requirement > Must add if sofa "has wheels (i.e. is a car)" Improved Solution (Business)

Slide 18

Slide 18 text

Addressing the Issues Viewpoints > Differing solutions to a problem > Different understanding of how outcomes are obtained

Slide 19

Slide 19 text

Addressing the Issues Viewpoints > Is a key factor missing? > Misunderstanding the problem > Unknown requirements > Translation issues > Before coding - Think > “Does the requirement/solution make sense?"

Slide 20

Slide 20 text

Scenario 3 Differing Viewpoints > Requirement > Must add if sofa "is a car”. > Cars can be moved. > Problem with current solution > Requirement doesn't make sense. > Confirm actual requirement with person making them! > Scenario > Sofa location must be updated when moved. Person making requirements considers movable objects to be cars.

Slide 21

Slide 21 text

Scenario 3 > Adjusted requirement > Sofas must be movable Improved Solution

Slide 22

Slide 22 text

Addressing the Issues Push Back > Be polite > Don't be afraid to push back if something doesn't seem right

Slide 23

Slide 23 text

Addressing the Issues Push Back > Suggest alternatives > Explain the problem clearly

Slide 24

Slide 24 text

Thank You