Slide 1

Slide 1 text

API Driven Development Kenneth Reitz How I Develop Things and Why. Thursday, October 11, 12

Slide 2

Slide 2 text

Hi. Thursday, October 11, 12

Slide 3

Slide 3 text

@kennethreitz Thursday, October 11, 12

Slide 4

Slide 4 text

Thursday, October 11, 12

Slide 5

Slide 5 text

Open Source Thursday, October 11, 12

Slide 6

Slide 6 text

Requests HTTP for Humans Thursday, October 11, 12

Slide 7

Slide 7 text

Httpbin.org $ curl http://httpbin.org/get?test=1 { "url": "http://httpbin.org/get", "headers": { "Content-Length": "", "Connection": "keep-alive", "Accept": "*/*", "User-Agent": "curl/7.21.4 ...", "Host": "httpbin.org", "Content-Type": "" }, "args": { “test”: “1” }, "origin": "67.163.102.42" } Thursday, October 11, 12

Slide 8

Slide 8 text

Et Cetera • Legit: Git Work ow for Humans • Envoy: Subprocess for Humans • Tablib: Tabular Data for Humans • Clint: CLI App Toolkit • Autoenv: Magic Shell Environments • OSX-GCC-Installer: Provokes Lawyers 275+ More Thursday, October 11, 12

Slide 9

Slide 9 text

Purpose Thursday, October 11, 12

Slide 10

Slide 10 text

We’re Diverse. • Product guys: non-tech cofounders • Sales guys: hustlers • Marketers: spammers • Designers: pixel pushers • Developers: code monkeys We come from many backgrounds. Thursday, October 11, 12

Slide 11

Slide 11 text

What do we have in common? Thursday, October 11, 12

Slide 12

Slide 12 text

We’re Makers. • Product guys: visionaries • Sales guys: sustainability • Marketers: communication • Designers: experience and philosophy • Developers: make the magic happen We craft experiences & interfaces. Thursday, October 11, 12

Slide 13

Slide 13 text

Developers! Developers, Developers, Developers. Thursday, October 11, 12

Slide 14

Slide 14 text

— Steve Jobs, 1983 People are going to be spending two or three hours a day with these machines — more than they spend with a car. Thursday, October 11, 12

Slide 15

Slide 15 text

— Steve Jobs, 1983 Software design must be given at least as much consideration as we give automobiles today — if not a lot more. Thursday, October 11, 12

Slide 16

Slide 16 text

That worked. Thursday, October 11, 12

Slide 17

Slide 17 text

Beautiful Interfaces. • Industrial Design • Web Interfaces • iOS, Android, Mobile Apps • Desktop Clients & Applications Today, beautiful applications abound. Thursday, October 11, 12

Slide 18

Slide 18 text

Hackers are the real Makers. Thursday, October 11, 12

Slide 19

Slide 19 text

Developers spend 8+ hours a day with APIs. Why are they treated di erently? Thursday, October 11, 12

Slide 20

Slide 20 text

Web Application Thursday, October 11, 12

Slide 21

Slide 21 text

Web Application Tools & Utilities Web Process Worker Process Thursday, October 11, 12

Slide 22

Slide 22 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Thursday, October 11, 12

Slide 23

Slide 23 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks Thursday, October 11, 12

Slide 24

Slide 24 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 25

Slide 25 text

Thursday, October 11, 12

Slide 26

Slide 26 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 27

Slide 27 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 28

Slide 28 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 29

Slide 29 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 30

Slide 30 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 31

Slide 31 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 32

Slide 32 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 33

Slide 33 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 34

Slide 34 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 35

Slide 35 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 36

Slide 36 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 37

Slide 37 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 38

Slide 38 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 39

Slide 39 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 40

Slide 40 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 41

Slide 41 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 42

Slide 42 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 43

Slide 43 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 44

Slide 44 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 45

Slide 45 text

Web Application Management Tools Supporting Services Tools & Utilities Web Process Worker Process Scheduled Tasks Deferred Tasks API Service CRUD Admin Data Persistence User Interface Authentication Thursday, October 11, 12

Slide 46

Slide 46 text

Thursday, October 11, 12

Slide 47

Slide 47 text

End Users Thursday, October 11, 12

Slide 48

Slide 48 text

End Users Developers Thursday, October 11, 12

Slide 49

Slide 49 text

End Users API Service Developers Thursday, October 11, 12

Slide 50

Slide 50 text

API Service End Users API Service Developers Thursday, October 11, 12

Slide 51

Slide 51 text

API Service End Users API Service Developers Thursday, October 11, 12

Slide 52

Slide 52 text

API Service End Users API Service API Service Developers Thursday, October 11, 12

Slide 53

Slide 53 text

API Service End Users API Service API Service Developers ( ) Thursday, October 11, 12

Slide 54

Slide 54 text

API Service End Users API Service API Service Developers ( ) Data Persistence Thursday, October 11, 12

Slide 55

Slide 55 text

API Service End Users API Service Internal API Service Developers ( ) Data Persistence Thursday, October 11, 12

Slide 56

Slide 56 text

API Service End Users API Service Internal API Service Developers ( ) Data Persistence Message Queue Workers Thursday, October 11, 12

Slide 57

Slide 57 text

Everything is a remix*. * APIs Rule Everything Around Us. Thursday, October 11, 12

Slide 58

Slide 58 text

How? Thursday, October 11, 12

Slide 59

Slide 59 text

Step I: Have an Issue. Thursday, October 11, 12

Slide 60

Slide 60 text

A Real, Tangible Problem. You can't solve a problem properly if you don't experience it rsthand. Thursday, October 11, 12

Slide 61

Slide 61 text

Example: OneNote. • Hierarchical, freeform note-taking software that assumes nothing. • Only available on Windows. • I want to make OneNote for OS X. • It would be incredible. The nest note-taking platform on earth. Thursday, October 11, 12

Slide 62

Slide 62 text

GitHub Success • GitHub wasn't built for the developer community at large. • Resonated with millions of developers. • They themselves happen to be developers. Over two million people collaborating. Thursday, October 11, 12

Slide 63

Slide 63 text

Other’s Success • Gumroad, built for the founder. • 37 Signals product, build for the team. • Ruby on Rails, by Rubyists for Rubyists. Thursday, October 11, 12

Slide 64

Slide 64 text

Optimization • Feature driven development? • Pro t driven development? • Growth driven development? • Problem driven development. What drives your decisions? Thursday, October 11, 12

Slide 65

Slide 65 text

pra•gmat•ic |pragˈmatik|, adj: Dealing with things sensibly and realistically in a way that is based on practical rather than theoretical considerations Thursday, October 11, 12

Slide 66

Slide 66 text

Requests Success • Python is a language built for Humans. • Why should HTTP be non-trivial? • I explored and discovered what I really needed, and built it. • I had a real problem that I solved for myself. Thursday, October 11, 12

Slide 67

Slide 67 text

Requests Success • At rst, Requests was far from powerful. • But, it deeply resonated with people. • Features grew over time, but the API was never compromised. • Quite popular. Thursday, October 11, 12

Slide 68

Slide 68 text

Developers spend 8+ hours a day with APIs. Build for yourself—a developer. Thursday, October 11, 12

Slide 69

Slide 69 text

Step II: Respond. Thursday, October 11, 12

Slide 70

Slide 70 text

Write the README. Thursday, October 11, 12

Slide 71

Slide 71 text

• Before any code is written, write the README — show some examples. • Write some code with the theoretical code that you’ve documented. Thursday, October 11, 12

Slide 72

Slide 72 text

Achievement Unlocked! • Instead of engineering something to get the job done, you interact with the problem itself and build an interface that reacts to it. • You discover it. You respond to it. Thursday, October 11, 12

Slide 73

Slide 73 text

• Great sculptures aren’t engineered or manufactured—they’re discovered. • The sculptor studies and listens to the marble. He identi es with it. • Then, he responds. • Setting free something hidden that inside all along. Sculptures, Etc. Thursday, October 11, 12

Slide 74

Slide 74 text

• It’s not about a design that will “work” on a phone, tablet, and desktop. • It’s about making something that identi es itself enough to respond to the environment it’s placed in. • Free of arbitrary constraints. Responsive Design Thursday, October 11, 12

Slide 75

Slide 75 text

Readme-Driven Development? Responsive API Design. Thursday, October 11, 12

Slide 76

Slide 76 text

Step III: Build. Thursday, October 11, 12

Slide 77

Slide 77 text

• Once you discover the API: build it. • Write all the code necessary to make exactly what you documented happen. • Complex code? Layer your API. • “Porcelain” layer is documented. Responsive Design Thursday, October 11, 12

Slide 78

Slide 78 text

The API is all that matters. Everything else is secondary. Thursday, October 11, 12

Slide 79

Slide 79 text

Do unto others as you would have them do to you? Build tools for others that you want to be built for you. Thursday, October 11, 12

Slide 80

Slide 80 text

Pro Tips™ Thursday, October 11, 12

Slide 81

Slide 81 text

CONSTRAINTS FOSTER CREATIVITY Thursday, October 11, 12

Slide 82

Slide 82 text

Open Source All The Things! Thursday, October 11, 12

Slide 83

Slide 83 text

Build for Open Source • Components become concise & decoupled. • Concerns separate themselves. • Best practices emerge (e.g. no creds in code). • Documentation and tests become crucial. • Code can be released at any time. Thursday, October 11, 12

Slide 84

Slide 84 text

Build for Open Source • Components become concise & decoupled. • Concerns separate themselves. • Best practices emerge (e.g. no creds in code). • Documentation and tests become crucial. • Code can be released at any time. Thursday, October 11, 12

Slide 85

Slide 85 text

Build for Services • Components become concise & decoupled. • Concerns seperate themselves. • Best practices emerge (e.g. ideal tools). • Documentation and contracts become crucial. • Services can be scaled separately at any time • Dogfood is delicious. Thursday, October 11, 12

Slide 86

Slide 86 text

— Pieter Hintjens Simplicity is always better than functionality. Thursday, October 11, 12

Slide 87

Slide 87 text

github.com/kennethreitz Questions? Thursday, October 11, 12