“Writing Code That Lasts” … Or Writing Code You Won’t Hate Tomorrow

Понравилась презентация – покажи это...

Слайд 0

photo: djandyw.com Writing code that lasts. #ocforphp Rafael Dohms

Слайд 1

photo: djandyw.com Writing code 
 you won’t hate tomorrow. #ocforphp Rafael Dohms

Слайд 2

Let me introduce you to someone…

Слайд 3

Слайд 4

Слайд 5

No Tests. shhh.. don’t tell Grumpy. Wrote his own framework. .. and used it. Used Singletons! .. and every other anti-pattern out there. 500 line methods. … not even methods, they were functions

Слайд 6

photo: Rob Allen (@akrabat)

Слайд 7

Слайд 8

REWRITE ALL THE CODE! image: hyperboleandahalf

Слайд 9

photo: Glyn Lowe Photoworks Real Developers, SHIP STUFF.

Слайд 10

Слайд 11

Слайд 12

Слайд 13

photo: Kalexanderson How do we find balance?

Слайд 14

photo: CarbonNYC Code has an expiration date

Слайд 15

photo by: massdistraction Code is perishable, it rots.

Слайд 16

photo by: kevin dooley Code Evolves

Слайд 17

Languages evolve. photo by: raneko

Слайд 18

photo by: Kaptain Kobold You evolve.

Слайд 19

photo: osbornb Complexity 
 kills Comprehension

Слайд 20

photo: miskan Bad Design

Слайд 21

Bad specs

Слайд 22

photo by: John 'K' NIH source: Urban dictionary

Слайд 23

photo by: John 'K' NIH | nɒt ɪnˈventɪd hɪə |
 Not Invented Here —The German art of humiliating any technology, agricultural product, or (medical) scientific work that has not been invented or produced in Germany, Switzerland, or Austria. source: Urban dictionary

Слайд 24

photo: Ian Sane The Solution™

Слайд 25

Improve code

Слайд 26

make it easier to comprehend Improve code

Слайд 27

make it flexible make it easier to comprehend Improve code

Слайд 28

make it flexible make it tested make it easier to comprehend Improve code

Слайд 29

make it flexible make it tested make it easier to comprehend Improve code make it easier to replace, refactor

Слайд 30

make it flexible make it tested make it easier to comprehend Improve code make it not exist make it easier to replace, refactor

Слайд 31

Testing photo by: jeffkrause

Слайд 32

Good Design Concepts

Слайд 33

photo by j_regan SOLID Single Responsibility
 Open and Close
 Liskov substitution
 Interface Segregation
 Dependency Inversion

Слайд 34

photo by lofink STUPID Singleton
 Tight Coupling
 Premature Optimization
 Indescriptive Naming

Слайд 35

photo by halloweenstock Design Patterns

Слайд 36


Слайд 37

PIE Proudly

Слайд 38

photo by j_regan guzzlehttp/guzzle HTTP client for RESTful API clients

Слайд 39

league/tactician A flexible CommandBus implementation

Слайд 40

Readability photo: Morgenland

Слайд 41

photo: Trossachs Photography paragraphs

Слайд 42


Слайд 43

Слайд 44

Cape Town São Paulo R&D Team for MIH/Naspers

Слайд 45

Object Calisthenics photo by: boston_public_library

Слайд 46

photo by: boston_public_library Calisthenics /ˌkaləsˈTHeniks/ Calisthenics are a form of dynamic exercise consisting of a variety of simple, often rhythmical, movements, generally using minimal equipment or apparatus.

Слайд 47

Its about perception, not rules or standards photo by: david_a_l

Слайд 48

photo by: justinliew #1 Only one indentation level per method.

Слайд 49

photo by: justinliew #2 Do not 
 use else

Слайд 50

Слайд 51

Слайд 52

Слайд 53

photo by: justinliew #3 Wrap primitive types, if they contain behavior

Слайд 54

photo by: justinliew #4 Only one 
 -> per line

Слайд 55

photo by: justinliew #5 Do not abbreviate.

Слайд 56

photo by: justinliew #6 Keep your classes small.

Слайд 57

photo by: justinliew #7 Limit your instance variables to less then 5

Слайд 58

photo by: justinliew #8 Use first class collections

Слайд 59

photo by: justinliew #9 Use getters and setters.

Слайд 60

photo by: justinliew #10 Document your code.

Слайд 61

Your turn.

Слайд 62

Improve yourself!

Слайд 63

Read lots of code!

Слайд 64

Write simple code.

Слайд 65

Try Object Calisthenics for a month.

Слайд 66

Use someone else’s code.

Слайд 67

Share bite size libraries.

Слайд 68

http://tech.sym.bid/jobs we are hiring! Thank you. @rdohms http://doh.ms http://slides.doh.ms

Слайд 69

Video recording Resources on 
 Object Calisthenics Books Slides http://l.doh.ms/oc-material

Слайд 70