41
From monkey coders to smart gorillas @researcheneur | [email protected] Dublin Web Summit, 2014

From Monkey Coders To Smart Gorillas - Web Summit 2014

Embed Size (px)

Citation preview

From monkey coders to smart gorillas

@researcheneur | [email protected]

Dublin Web Summit, 2014

KEEPCALM

AND

LEARNFROM

MISTAKES

0101010010 0100100110 0101010010 0101010100

CODE COMMUNICATION

2 developers

Full-stack Web Framework

Dependencies, dependencies, dependencies…

No real unit tests

FAIL

• Even in early stage, iterations can share code

• Code built today should be useful tomorrow

• Modularity helps

class User field :name, type: String field :email, type: String field :gender, type: String embeds_one :profile end

add_column :users, :name, :string add_column :users, :email, :string add_column :users, :gender, :string add_column :users, :profile_id, :reference

SQL

MongoDB

User.find(id) # => Mongoid::Errors::DocumentNotFound

User.find(id) # => ActiveRecord::RecordNotFound

SQL

MongoDB

Microframework + Custom stack

Structure

Validations

MODEL

user = User.new(email: ‘[email protected]’, name: ‘John’)

user.to_h # => { email: ‘[email protected]’, name: ‘John’ }

User.new(user.to_h)

MODEL

Responsible for serializing and deserializing

repo = UserRepository.new(db_config)

repo.put(user)

repo.find_one_by_id(user.id)

REPOSITORY

Responsible for storage and retrieval

user_service = UserService.new(user_repository)

user_service.visit_profile(user_id)

user_service.deactivate(current_user_id)

SERVICE

Business logic using models and repos

MODELS

MODELS REPOSITORIES

MODELS REPOSITORIES

SERVICES

MODELS REPOSITORIES

SERVICES

JSON API MIDDLEWARE

MODELS REPOSITORIES

SERVICES

JSON API MIDDLEWARE

WEB FACADE

MODELS REPOSITORIES

SERVICES

JSON API MIDDLEWARE

WEB FACADE MOBILE APP

Ruby magic

class API api :get, ‘/:user_id’, :user_service, :visit_profile

api :delete, '/me', :user_service, :deactivate

... end

time

progress

DIRTY CODING

time

progress

CODE REFACTORING

While refactoring, nothing is produced

Startup programmers need to think of the WHY

Think of ROI of current task

OK when we were landing page size

We had Text Files and our heads

We got lost in small tasks

Then we had Pivotal Tracker-style tools

Still got lost in small tasks

We tried Kanban

Yeah, got lost in small tasks

We had Scrum meetings

VISION

VISION

BIG HAIRY AUDACIOUS GOAL (BHAG)

VISION

BIG HAIRY AUDACIOUS GOAL (BHAG)

KPI KPI KPI KPI

VISION

BIG HAIRY AUDACIOUS GOAL (BHAG)

KPI KPI KPI KPI

WEB MOBILE APP B2B API

VISION

BIG HAIRY AUDACIOUS GOAL (BHAG)

KPI KPI KPI KPI

WEB MOBILE APP B2B API

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

VISION

BIG HAIRY AUDACIOUS GOAL (BHAG)

KPI KPI KPI KPI

WEB MOBILE APP B2B API

VIEWS MODEL DBANDROID

CODEIOS

CODESALES PR

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

VISION

BIG HAIRY AUDACIOUS GOAL (BHAG)

KPI KPI KPI KPI

WEB MOBILE APP B2B API

VIEWS MODEL DBANDROID

CODEIOS

CODESALES PR

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

FUNCTIONALITY

Jarg

on

The

rea

l shi

t

Think of what you’re actually doing

I’m coding

I’m coding this method to

let users log in with Facebook,

which affects the web product

to improve login conversion,

getting closer to the goal of…

in order to build a world where…

Jargon

Feature

Product

KPI

Goal

Vision

@researcheneur | [email protected]

Dublin Web Summit, 2014