Slide 1

Slide 1 text

TIME DRIVEN DEVELOPMENT @ktrajchevska Katerina Trajchevska, Laracon EU

Slide 2

Slide 2 text

Exclusive Developers’ Network Katerina Trajchevska ● Software Engineer & Mozilla Tech Speaker ● Co-founder of Adeva, an exclusive developers’ network. ● Consultant with startups and Fortune 500 @ktrajchevska

Slide 3

Slide 3 text

@ktrajchevska I often leave the office 1-2 hours later than my co-workers after polishing some piece of ultimately meaningless code. This is time I don’t spend with my family. Because I’ve learned to care about Clean Code. - Johannes Broadwall, Forget about Clean Code, let’s embrace Compassionate Code

Slide 4

Slide 4 text

@ktrajchevska ⚠ “Refactor away from SRP”

Slide 5

Slide 5 text

@ktrajchevska We fully test our software. or We practice TDD. or We follow SOLID principles. The bottom line is simply that we go home every night, look in the mirror, and are proud of what we accomplished that day. - Uncle Bob, The Obligation of the Programmer

Slide 6

Slide 6 text

We’ve created a toxic environment that values the usage of good design pracNces above creaNng value for the user.

Slide 7

Slide 7 text

@ktrajchevska

Slide 8

Slide 8 text

Why Time Driven Development?

Slide 9

Slide 9 text

Example #1 Adeva PlaVorm: Building developers’ profiles.

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

App\ZohoCandidate.php

Slide 12

Slide 12 text

App\Http\Controllers\CandidateController.php Controller knows too much and is open for modificaNon. Methods depend directly on the CRM storage and their naming convenNons.

Slide 13

Slide 13 text

profile.blade.php View uses arrays that should be replaced with CollecNons in future.

Slide 14

Slide 14 text

@ktrajchevska What does it take to switch the storage? 1. Add Eloquent models to use with MySQL. 2. Change controller dependencies from CRM class to Eloquent. 3. Use Eloquent instead of CRM to pull data for the view. 4. Switch all variables to the new naming convention. 5. Change the way we access data in the views. 6. Adjust the unit tests to work accordingly.

Slide 15

Slide 15 text

How can we save time by improving the code design?

Slide 16

Slide 16 text

1. Don’t depend on concrete implementaNons.

Slide 17

Slide 17 text

App\Repositories\Interfaces\CandidateRepositoryInterface.php

Slide 18

Slide 18 text

App\Http\Controllers\CandidateController.php

Slide 19

Slide 19 text

2. Be mindful about what your program expects.

Slide 20

Slide 20 text

App\Crm\Candidate.php

Slide 21

Slide 21 text

profile.blade.php

Slide 22

Slide 22 text

3. Bind abstractions with concrete implementation.

Slide 23

Slide 23 text

App\Providers\AppServiceProvider.php

Slide 24

Slide 24 text

@ktrajchevska What does it take to switch the storage? 1. Add Eloquent models to use with MySQL. 2. Create MysqlCandidateRepository that implements CandidateRepositoryInterface. 3. Change the binding for CandidateRepositoryInterface in AppServiceProvider.

Slide 25

Slide 25 text

Example #2: Adeva PlaVorm: Pulling data from Github

Slide 26

Slide 26 text

Integrations\VersionControl\VersionControlFactory.php

Slide 27

Slide 27 text

App\Integrations\Interfaces\AbstractVersionControl.php

Slide 28

Slide 28 text

Integrations\VersionControl\Github.php

Slide 29

Slide 29 text

App\Http\Controllers\Admin\CandidateController.php

Slide 30

Slide 30 text

@ktrajchevska

Slide 31

Slide 31 text

Is there a better way to do it?

Slide 32

Slide 32 text

App\Http\Controllers\Admin\CandidateController.php

Slide 33

Slide 33 text

@ktrajchevska Why Time Driven Development? ● Software design practices come with trade-offs. Know them. ● Software design principles should simplify your life, not complicate it. ● Thinking about the bigger picture will help you create more than just software. It will help you create value.

Slide 34

Slide 34 text

@ktrajchevska How to start pracDcing Time Driven Development? ● Talk to your lead to understand the business goals before proposing an architecture. ● Always have the context in mind when designing soeware. ● Don’t shame others for not adhering to “the best” soeware design pracNces.

Slide 35

Slide 35 text

Soeware Design Principles are your tools, not your goals.

Slide 36

Slide 36 text

Thank you! @ktrajchevska adeva.co Exclusive developers’ network.