If Your Code Looks Like This... You're A GOOD Programmer

Continuous Delivery
31 Jul 202416:39

Summary

TLDRIn this video, Dave Farley of Continuous Delivery discusses the concept of 'bad code' and its impact on productivity and system quality. He argues that good code should be functional and easy to modify. Farley emphasizes the importance of quality over quick, substandard solutions, citing data showing that higher quality code leads to more efficient feature development. He also touches on readability, complexity, and testability as key factors in code quality, using a real-world example to illustrate his points and advocating for modern software engineering practices.

Takeaways

  • πŸ˜€ Bad code is generally defined by its inability to perform its intended function or its difficulty to change when necessary.
  • πŸ” The speaker argues that good code should be easy to change and maintain, which is more important than aesthetic appeal or over-engineering.
  • πŸ“ˆ High-quality code is linked to higher efficiency and productivity, with teams producing better quality code spending more time on new features.
  • πŸ› οΈ The professional duty of software developers includes building high-quality software efficiently, which is essential for long-term success.
  • πŸ’‘ The script suggests that good code is not just about fulfilling its purpose but also about being easy to change, which is a foundational principle.
  • πŸ“š The importance of readability is discussed, emphasizing that the best code should be understandable by anyone familiar with the problem, not just the original author.
  • 🧩 Complexity in code is managed by striving for readability and testability, which helps in maintaining modularity and separation of concerns.
  • πŸ”„ Test-driven development (TDD) promotes code that is easier to change and maintain due to its focus on modularity and cohesion.
  • πŸ”‘ The script uses an example of real-world code to illustrate principles of readability, simplicity, and the use of TDD for creating maintainable code.
  • πŸ” The concept of 'side effects' in code is touched upon, suggesting that minimizing them leads to more deterministic and simpler code behavior.
  • 🌟 The speaker emphasizes the importance of continuous learning and improvement in software development, acknowledging that there's always room for betterment in one's code.

Q & A

  • What is the main topic of the video?

    -The main topic of the video is defining bad code, understanding what it means, and exploring how to avoid it.

  • How does the speaker define 'bad code'?

    -The speaker defines bad code as code that either doesn't do what it should or is too hard to change when necessary.

  • What are the two primary characteristics of good code according to the speaker?

    -Good code is defined by two primary characteristics: it fulfills its purpose and is easy to change.

  • Why does the speaker believe that cutting corners to write code quickly is counterproductive?

    -The speaker believes that cutting corners to write code quickly is counterproductive because it leads to lower quality code, which ultimately slows down development due to the time required to fix issues later.

  • What does the Dora data say about teams that produce higher quality code?

    -The Dora data indicates that teams that produce higher quality code are significantly more efficient, spending 44% more of their time on producing new features than teams that do not produce high-quality code.

  • What is the speaker's view on the importance of readability in code?

    -The speaker believes that readability is crucial and that good code should be understandable by almost anyone who understands the problem being solved, whether they are technical or not.

  • How does the speaker suggest achieving readable code?

    -The speaker suggests achieving readable code by making each part of the code small and focused on a single part of the task, using descriptive names, and ensuring the intent of the code is clear to most people, including oneself in the future.

  • What role does test-driven development (TDD) play in writing good code according to the speaker?

    -According to the speaker, test-driven development (TDD) plays a significant role in writing good code by promoting modularity, cohesion, separation of concerns, abstraction, and sensibly managed coupling.

  • What example does the speaker provide to demonstrate readable and well-structured code?

    -The speaker provides an example from one of their pet projects, showing a small part of code that handles remote method calls. This example demonstrates small, focused pieces of code with descriptive names and clear separation of concerns.

  • What are some benefits of using modern software engineering tools and practices mentioned by the speaker?

    -The speaker mentions that using modern software engineering tools and practices, such as working iteratively in small steps and using TDD, helps in achieving readable, modular, and easy-to-change code.

Outlines

00:00

πŸ“ Understanding 'Bad Code' and Its Impact

Dave Farley introduces the concept of 'bad code' and its implications on productivity and system quality. He emphasizes that bad code is either non-functional or difficult to modify, and argues for the importance of creating good code from the start to avoid future issues. Farley also discusses the misconception that cutting corners leads to faster delivery, citing data that shows high-quality code production correlates with higher efficiency in feature development. The video aims to explore the definition of good code, practical steps to build it, and the pitfalls to avoid, using real-world examples.

05:01

πŸ” Defining Good Code and the Importance of Readability

The second paragraph delves into the characteristics of good code, suggesting that it should fulfill its purpose and be easy to change. It critiques the common lists that define bad code, proposing a more fundamental definition. Farley discusses the concept of readability, asserting that good code should be understandable not just by its author, but by anyone familiar with the problem it solves. He uses a personal project as an example to illustrate how code can be structured to be readable and maintainable, emphasizing the importance of clear naming and separation of concerns.

10:04

πŸ› οΈ The Role of Testability and Modularity in Code Quality

In this section, Dave Farley highlights the importance of testability in managing code complexity and ensuring quality. He explains how adopting test-driven development (TDD) promotes modularity, cohesion, separation of concerns, and sensible coupling. Farley uses the same real-world code example to demonstrate these principles in practice. The code is modular, with each component dedicated to a single task, and changes can be made easily without affecting other parts of the system. He also touches on the object-oriented nature of the code and the absence of side effects, contributing to its simplicity and predictability.

15:04

🌟 Embracing Modern Software Engineering Practices for Better Code

The final paragraph wraps up the discussion by emphasizing the value of modern software engineering practices like iterative development, test-driven development, and focused design experiments. Farley reflects on his own coding style, which results in simple, focused, and easy-to-understand code. He invites viewers to learn more about these practices through his book and encourages supporting the channel through Patreon. The summary underscores the benefits of writing code that is not only functional but also adaptable to change, which is crucial for long-term software maintenance and evolution.

Mindmap

Keywords

πŸ’‘Bad Code

Bad code refers to software that is either dysfunctional or difficult to work with. In the video, it is defined by two main criteria: it either doesn't perform its intended function or is too hard to modify when necessary. The concept is central to the video's theme, which is about understanding what constitutes bad code and how to avoid it. The script uses the term to initiate a discussion on code quality and the importance of writing maintainable and efficient code.

πŸ’‘Good Code

Good code is the antithesis of bad code. It is characterized by its ability to fulfill its intended purpose and its ease of modification. The video emphasizes that good code is not just about aesthetics but about practicality and efficiency. The script provides examples of what constitutes good code, such as being easy to change and having a direct impact on productivity and system quality.

πŸ’‘Continuous Delivery

Continuous delivery is a software development practice where code changes are automatically built, tested, and prepared for a release to production. Dave Farley, the host of the video, is introduced with this expertise, indicating that the principles of continuous delivery, such as automation and quality, are relevant to the discussion on bad and good code.

πŸ’‘Productivity

Productivity in the context of the video refers to the efficiency with which software teams can produce new features and make changes. It is tied to the quality of code, with the argument that higher quality code leads to greater productivity, as teams spend more time on feature development rather than fixing issues caused by bad code.

πŸ’‘Quality

Quality is a measure of how well the code meets its intended purpose and how easily it can be changed or maintained. The video argues that quality is crucial for commercial reasons, as it affects the speed and efficiency of software development. The script uses the term to highlight the importance of building high-quality software to ensure long-term efficiency and effectiveness.

πŸ’‘Professional Duty of Care

Professional duty of care is the ethical responsibility of software professionals to perform their work to the best of their abilities. In the video, it is mentioned as a reason why developers should focus on creating good code, as it is part of their professional responsibility to build software efficiently and effectively.

πŸ’‘Readability

Readability in the context of code refers to how easily the code can be understood by others. The video suggests that truly readable code should be understandable not just by its author but by anyone familiar with the problem domain. The script uses the term to discuss the importance of clear, descriptive naming and separation of concerns in making code more understandable and maintainable.

πŸ’‘Complexity

Complexity in the video refers to the difficulty in understanding or modifying the code. It is considered a problem when it makes the code hard to maintain or change. The script discusses how striving for readability and testability can help manage complexity, making the code easier to work with.

πŸ’‘Test-Driven Development (TDD)

Test-driven development is a software development technique where tests are written before the code that implements the functionality. The video mentions TDD as a practice that promotes greater modularity, cohesion, and separation of concerns, which in turn makes the code more maintainable and less complex.

πŸ’‘Modularity

Modularity in software development refers to the design principle of creating a program out of separate, interchangeable modules. The video script uses the term to describe how good code should be composed of small, focused pieces, each dedicated to a single part of the overall task, which contributes to the code's readability and ease of change.

πŸ’‘Separation of Concerns

Separation of concerns is a design principle for separating a computer program into distinct features that overlap in functionality as little as possible. The video emphasizes this principle as a way to make code more maintainable and easier to change, as each part of the code is responsible for one specific aspect of the functionality.

πŸ’‘Abstraction

Abstraction in programming is the process of reducing complexity by hiding details and exposing only the necessary features. The script discusses how abstraction helps in creating testable and modular code, by allowing each part to interact with others through simplified interfaces, thus reducing the impact of changes on the rest of the system.

πŸ’‘Scalability

Scalability refers to the ability of a system to handle growth, by scaling up or out when needed. While the video does not directly define the term, it implies that good code should be scalable, as part of fulfilling its purpose effectively. Scalability issues would fall under the category of the code not working as it's meant to.

πŸ’‘Resilience

Resilience in the context of software systems is the ability to withstand or recover quickly from a failure. The video mentions that resilience may be a defining characteristic of system quality, especially if uptime is critical to the business. Code that lacks resilience could be considered bad code in scenarios where reliability is paramount.

Highlights

Dave Farley introduces the topic of defining 'bad code' and its impact on productivity and system quality.

Bad code is characterized by its inability to perform its intended function or difficulty in making changes when necessary.

Good code should be easy to change and maintain, directly impacting the bottom line and feature development speed.

High-quality code is linked to higher efficiency, with teams spending more time on new features, according to Dora data.

Software professionals have a duty of care to build high-quality software efficiently, avoiding the trap of cutting corners.

Sponsorship acknowledgment for Equal Experts, Transic, and Semaphore, companies aligned with continuous delivery and software engineering topics.

Chat GPT's definition of bad code is discussed, emphasizing maintainability and the ease of making changes.

Good code should fulfill its purpose and be easy to change, with other qualities being special cases of these fundamentals.

The importance of context in defining code quality, such as resilience and uptime, which may vary depending on the business.

Common lists describing bad code often start with readability, but true readability extends beyond the author's understanding.

The best code is readable by anyone who understands the problem, not just the technical details.

An example of readable code from Dave Farley's pet project is presented, demonstrating clear intent and structure.

Readability is enhanced by small, focused code parts with descriptive names that convey their role in solving the problem.

Test-driven development (TDD) promotes modularity, cohesion, separation of concerns, and manageable coupling.

The example code is modular, making it easy to change and extend without impacting other parts of the system.

The importance of avoiding side effects and using final state for objects to ensure deterministic behavior.

The example demonstrates the use of modern software engineering practices to achieve simplicity and ease of change.

Invitation to learn more about software development practices through Dave Farley's book.

A call to action for Patreon support to help with the production of the channel's content.

Transcripts

play00:00

we all say it that code is bad this code

play00:03

is terrible but what does it mean and

play00:05

what should we do about it that's our

play00:07

topic for

play00:11

[Music]

play00:15

today hi I'm Dave Farley of continuous

play00:18

delivery and welcome to my channel if

play00:20

you haven't been here before please do

play00:22

hit subscribe and if you enjoy the

play00:23

content today hit like as well bad code

play00:26

is probably a bad name for bad code but

play00:29

at least collo

play00:30

if not technically we all know what we

play00:32

mean when we say it that is not how I

play00:35

would have done it or if it's our code

play00:38

that's bad it's not how I'd do it now

play00:41

with the benefit of hindsight bad code

play00:43

is code that is difficult or at least

play00:45

unpleasant to work on in this episode I

play00:48

want to explore what bad code really is

play00:51

what's a sensible practical definition

play00:53

for good code and what it takes to build

play00:56

good code and avoid traps in Bad Code

play00:59

based on some real world examples

play01:01

fundamentally bad code is defined I

play01:04

think by two things either it doesn't do

play01:06

what it should or even if it does do

play01:09

what it should it's too hard to change

play01:11

it when we need to change it I'd argue

play01:13

that that's it everything else is

play01:16

secondary to those two things if it does

play01:18

what it's meant to and it's easy to

play01:20

change then it's good code this is not

play01:23

about engineering as art or over

play01:26

engineering or software developers being

play01:28

over precious about the the beauty in

play01:30

their code this is practical pragmatic

play01:33

stuff it works and it's easy to change

play01:37

these things have a direct bottom line

play01:39

impact on the productivity as well as

play01:42

quality of the systems that we build if

play01:44

you want to go quickly and build lots of

play01:47

features you don't get to do that by

play01:49

cutting corners and writing bad code

play01:51

fast you do it by working more carefully

play01:54

to create good code from the start and

play01:57

so saving lots of unnecessary time and

play02:00

effort correcting the Fallout that your

play02:01

bad code cause later on I wish that more

play02:04

of us techies believed that and defended

play02:06

that idea more strongly to misguided

play02:09

people pressuring us to cut Corners to

play02:11

deliver faster because cutting Corners

play02:13

simply doesn't work the Dora data says

play02:16

that teams that produce higher quality

play02:18

code are significantly more efficient

play02:21

overall spending 44% more of their time

play02:25

on producing new features than teams

play02:27

that don't 44%

play02:29

that's a big win quality matters for

play02:32

commercial reasons because we go faster

play02:35

overall and we create better quality

play02:37

code so as software professionals we

play02:40

have a professional duty of care to do a

play02:43

good job this is not about

play02:45

self-indulgence or over engineering this

play02:48

is what we are paid to do our

play02:50

professional duty of care to build

play02:52

software as efficiently as we can to do

play02:55

that we need to build high quality

play02:56

software not create crap quickly because

play03:00

if we optimize to build crap quickly

play03:02

then the data says that we just end up

play03:04

building bad software more slowly the

play03:07

worst of all possible

play03:08

outcomes let me pause there and say

play03:11

thank you to our sponsors we are

play03:13

extremely fortunate to be sponsored by

play03:15

equal experts transic and semaphore

play03:19

equal experts is a consultancy built on

play03:22

the idea of applying the techniques that

play03:24

we talk about here to build great

play03:26

software for their clients transic is a

play03:28

financial technology startup applying

play03:31

Advanced continuous delivery techniques

play03:33

to deliver low latency trade routing

play03:35

services to some of the biggest

play03:37

financial institutions in the world and

play03:39

semifur are leading suppliers of

play03:41

cloud-based deployment pipeline

play03:44

Technology support for your projects all

play03:47

of these company offer products and

play03:49

services that are extremely well aligned

play03:50

with the topics that we discuss here

play03:52

every week so if you're looking for

play03:54

excellence in continuous delivery and

play03:56

software engineering please do click on

play03:58

their links in the description to below

play04:00

to show them your support so if bad code

play04:02

is so important what is it and what do

play04:05

we do to avoid it here is chat gpt's

play04:09

take on defining bad code it's not

play04:12

perfect but it's also not a bad summary

play04:14

either so if bad code is hard to

play04:17

maintain then clearly it isn't easy to

play04:19

change if it has scalability issues then

play04:23

it doesn't really work as it's meant to

play04:25

and all of these other things also fall

play04:27

into my two categories of of doing what

play04:30

it's meant to and then being easy to

play04:33

change which I think are the simpler

play04:35

more foundational and more useful ideas

play04:38

fundamentally good code needs to fulfill

play04:40

its purpose and be easy to change

play04:43

everything else is just a special case

play04:45

of those two things it's possible that

play04:47

I'm being a little bit overly reductive

play04:49

here but in this case I don't really

play04:52

think so because I can make my code

play04:54

scalable or write it to eliminate

play04:56

security vulnerabilities and it still

play04:59

might be bad code if it's hard to

play05:01

maintain or offers a poor user

play05:03

experience so if we fix all of these

play05:06

things is the code good now well maybe

play05:09

maybe not to achieve good code our code

play05:12

needs to fix all of these things and

play05:15

depending on context probably several

play05:18

more not listed here if uptime matters a

play05:20

lot to my business resilience may be a

play05:23

much more important defining

play05:25

characteristic of my systems quality

play05:27

than say scalability so code that isn't

play05:30

resilient is bad too but that isn't

play05:33

covered in this list in this case a

play05:36

detailed list is less helpful really

play05:38

than a generic statement of principle

play05:40

because we may always miss something off

play05:42

the list so although bad code is often

play05:45

defined with lists like these these

play05:48

aren't really definitions but rather

play05:51

only reminders of some of the things

play05:53

that we probably need to get right

play05:55

depending on our context but using the

play05:57

more fundamental definition of code as

play06:00

something that fulfills its purpose and

play06:03

is easy to change is always true so I

play06:07

think he's a much more useful tool to

play06:09

help guide our choices but let's dig in

play06:12

a little bit deeper than that most lists

play06:15

of things that describe code as bad look

play06:17

something like this and often they start

play06:20

with

play06:20

readability the problem with this is

play06:23

that it's my impression that what we

play06:26

mean when we say readability matters

play06:28

when comparing good code and bad is

play06:31

often rather ironically Lost in

play06:33

Translation I quite like this from the

play06:35

C2 Wiki and one of the most amusing

play06:38

things about it are the comments there's

play06:40

a link in the description to those if

play06:41

you want to check them out the comments

play06:43

argue quite a bit about the ins and outs

play06:46

of these five lines of code and the

play06:49

coding practice exhibited by them which

play06:51

goes to show that good and bad are

play06:54

somewhat subjective ideas when we get

play06:56

too lost in the detail the code that

play06:58

fulfills purpose and code that's easy to

play07:02

change are a lot less

play07:04

subjective closer to real measures of

play07:07

practical outcomes that really matter to

play07:09

us but back to my current Point

play07:12

fundamentally readability doesn't mean

play07:15

that you the author can read it of

play07:17

course you can in the moment that you

play07:19

wrote it you must be able to read it

play07:21

otherwise you couldn't have written it

play07:23

but that is nowhere close to good enough

play07:26

not a high enough bar to strive for

play07:28

readability means cons considerably more

play07:30

than that I think that the best code is

play07:33

readable by almost anyone who

play07:35

understands the problem being solved

play07:38

technical or not if you're writing

play07:40

medical software a non-programming

play07:43

doctor would understand the core logic

play07:45

of your system with some help if you're

play07:48

writing a game a game player should be

play07:50

able to follow the logic of your

play07:52

reasoning again probably with some help

play07:55

I think that this is a good sanity check

play07:57

to think of the least technical person

play07:59

who understands the problem being able

play08:02

to read and understand the intent of the

play08:04

code I don't always achieve that in my

play08:07

own code but I think that I usually

play08:09

write code that I could at least easily

play08:11

explain to them here's an example from

play08:14

one of my pet projects this is a

play08:16

technical code but Within These

play08:18

constraints I think it's readable so

play08:21

let's try that out this is a small part

play08:24

of some infrastructure that is meant to

play08:27

take a Java class and use it to generate

play08:30

remote calls and remote proxies to

play08:32

handle those remote calls translating

play08:34

them into calls into a service this code

play08:37

is on the receiver end of one of those

play08:39

remote method calls and so represents a

play08:42

translation from a remote call of some

play08:45

kind into a local call to the code that

play08:47

actually does the work none of this

play08:49

matters very much except as scene

play08:51

setting context so that you can

play08:54

understand the goals of this code the

play08:56

class is a runtime translator and here

play09:00

we are registering the service that has

play09:02

the method that does the work and

play09:04

creating a translator for one specific

play09:07

method call within that service

play09:09

identified by the method parameter to

play09:11

this Constructor I know that I'm largely

play09:13

just read repeating what the code

play09:15

already says but that is kind of the

play09:18

point I think that this is all that you

play09:21

need to know to put this code into

play09:23

context but let's look at the next layer

play09:25

down and note this code is internally

play09:29

layered and named so that each part is

play09:31

focused on only one part of the job we

play09:33

have a layer of abstraction within this

play09:35

class public methods that orchestrate

play09:38

the work private methods that then do

play09:40

the work so now what we want is to

play09:43

create a collection of parameter

play09:45

decoders is the code for that and sure

play09:49

there's some technical boiler plate

play09:50

imposed by Java here for creating fix

play09:53

size arrays and so on which we may have

play09:55

to explain to our non-technical reader

play09:59

but for a moment try and separate the

play10:01

meaning of the intent of this code from

play10:03

the plumbing of how Java works the core

play10:06

of what is happening here the plumbing

play10:08

aside is I hope pretty clear even to our

play10:12

non-technical reader we're creating a

play10:15

new parameter decoder for each parameter

play10:17

and saving it for later use here's the

play10:20

code that uses it later when a method is

play10:23

invoked this code is called and it

play10:25

iterates over its predefined list of

play10:27

parameter decoders that that we stored

play10:29

earlier and uses them to decode each

play10:32

parameter in turn and then it makes the

play10:34

method core with those decoded

play10:36

parameters there are several things that

play10:39

I think help this code to be readable

play10:42

each part of the code is small and

play10:44

focused on a simple part of the task

play10:47

I've chosen names that I aim to be

play10:49

descriptive in terms of the problem and

play10:51

their role in solving it given the

play10:54

context of the problem I'm aiming for

play10:56

names that are meaningful and

play10:58

practically given an understanding of

play11:00

the context clear enough that their role

play11:02

in solving the problem is clear to most

play11:05

people including me in the future and in

play11:08

that last respect this code was indeed

play11:10

readable because I wrote this some years

play11:13

ago and still understood it well enough

play11:15

now to try and explain it to you I think

play11:17

that this counts as readable code second

play11:20

in this list of common problems though

play11:22

with bad code is complexity striving for

play11:25

readability in the sense of easy

play11:27

understandability helps us to manage

play11:29

complexity certainly but even more so

play11:33

working to prefer testable code helps

play11:36

with that to by adopting test driven

play11:39

development it's difficult to avoid

play11:41

preferring testable code in our designs

play11:44

it promotes greater modularity cohesion

play11:46

separation of concerns abstraction and

play11:48

sensibly managed coupling it's hard to

play11:51

write testable code that doesn't

play11:52

demonstrate those features let's look

play11:55

again at my very simple real world code

play11:58

as I said this is part of a real world

play12:00

personal project it's not written as a

play12:02

demo for this video that's why I chose

play12:05

it I developed it from scratch with test

play12:07

driven development and it works and does

play12:09

what it's meant to do but it's also very

play12:12

easy to change because it is modular

play12:14

it's a collection of several small

play12:16

pieces each one dedicated to a small

play12:19

Single part of the overall task so it's

play12:21

also cohesive and has good separation of

play12:25

concerns because each part does one

play12:27

thing and everything needed to achieve

play12:30

that one thing is within the small

play12:31

relatively simple piece of code each

play12:33

piece of code interacts with others

play12:35

through abstractions that hide

play12:37

information The Constructor delegates

play12:40

the most complicated part of the

play12:41

initialization to a private method

play12:44

that's clearly named for what it is that

play12:46

it achieves in the context of the

play12:47

Constructor that allows me to keep the

play12:50

intent of the Constructor clear to any

play12:52

reader these abstractions hide

play12:54

information depending on the fewest

play12:56

simplest parameters to get the job done

play12:59

so even internally it's also minimally

play13:02

coupled to achieve its job and each part

play13:04

of the code even at the level of methods

play13:07

within a class is abstracted from every

play13:09

other so that I can change any single

play13:12

method with minimal or zero impact on

play13:15

the others there is more to even these

play13:18

few lines though this code is clearly

play13:21

objectoriented in terms of design a

play13:23

react service method is an object and it

play13:26

contains a collection of instances of

play13:28

parameter decoders which are abstract

play13:31

and polymorphic and aimed at decoding

play13:34

specific types of method parameters

play13:36

there is a state and behavior here so

play13:39

it's definitely objectoriented but look

play13:41

a little closer this code also has no

play13:44

side effects all of the state in these

play13:47

things is created during its

play13:48

initialization and is declared final

play13:51

which in Java means that it won't change

play13:53

once it has been initialized so the

play13:56

state never changes for a given instance

play13:59

this too limits unexpected changes in

play14:01

Behavior later and even though it's a

play14:04

functional idea perhaps here I'm using

play14:07

it in an O system so this code is

play14:09

behaviorally simpler and so more

play14:11

deterministic as a result I'm not using

play14:14

this code to boast about my design or as

play14:17

an example of perfection I'm sure that

play14:20

there are ways that it could be better

play14:22

I'm always sure that there are ways that

play14:23

my code could be better I don't know if

play14:25

you will agree with me or not that it

play14:28

it's able and less complex but even if

play14:31

you don't given that it is well unit

play14:34

tested as a result of being built with

play14:36

tdd from the start I hope that you will

play14:38

agree that this Cod is certainly easy to

play14:40

change for example I can trivially add

play14:44

support for new parameter types if I

play14:46

want to without changing any of the code

play14:48

that I've shown you so far and because

play14:50

of the separation of concerns in my

play14:52

design you have no idea how the

play14:54

transport of the data representing a

play14:56

method core works or how messages are

play14:59

rooted between caller and receiver these

play15:01

are indeed separate concerns and so

play15:03

don't impact on this part of the code at

play15:06

all I chose this code because it's real

play15:08

world not some artificial example this

play15:11

is what my code tends to look like when

play15:13

I write it I also chose it because I

play15:16

think it demonstrates what I mean about

play15:18

using the tools of modern software

play15:20

engineering to guide me towards what I

play15:22

think are better results by working

play15:24

iteratively in small steps and using

play15:26

tests via test driven development and

play15:29

small focused experiments in Design This

play15:32

is the sort of code that I tend to end

play15:34

up with if you'd like to learn more

play15:35

about that and how to do it do check out

play15:38

my book each part here is consciously

play15:41

designed to be as simple as I can make

play15:43

it each part even each function method

play15:47

or variable is focused on doing one

play15:49

thing and so I think that all of these

play15:52

things help to make this code easier to

play15:55

understand more readable and so more

play15:57

likely to achieve my goals for the code

play16:00

whatever they may be they also make the

play16:02

code much easier to change when I've got

play16:04

something wrong or the circumstances of

play16:06

the use of my code change and require me

play16:08

to change it to match them thank you

play16:10

very much for watching and if you're not

play16:12

already a patreon supporter please do

play16:14

consider joining and supporting our

play16:16

Channel and and our production of this

play16:18

content and thank you to all of our

play16:20

existing patreon supporters so far there

play16:23

are lots of benefits to joining as a

play16:25

patreon member and lots of additional

play16:27

information that you can gain from there

play16:30

thank you and bye-bye

play16:33

[Music]

Rate This
β˜…
β˜…
β˜…
β˜…
β˜…

5.0 / 5 (0 votes)

Related Tags
Software QualityCode MaintenanceBest PracticesTest-Driven DevelopmentDeveloper InsightsProductivity ImpactCode ReadabilityTechnical DebtContinuous DeliverySoftware Craftsmanship