Slide 1

Slide 1 text

Hi, I’m Coby.

Slide 2

Slide 2 text

Hi, I’m @cobyism.

Slide 3

Slide 3 text

Product design at GitHub.

Slide 4

Slide 4 text

A selection of interesting* things I’ve learnt doing design at GitHub. *Actual levels of interestingness may vary.

Slide 5

Slide 5 text

Let’s talk about Philosophy

Slide 6

Slide 6 text

GitHub Zen

Slide 7

Slide 7 text

• Responsive is better than fast. • It’s not fully shipped until it’s fast. • Anything added dilutes everything else. • Practicality beats purity. • Approachable is better than simple. • Mind your words, they are important. • Speak like a human. • Half measures are as bad as nothing at all. • Encourage flow. • Non-blocking is better than blocking. • Favor focus over features. • Avoid administrative distraction. • Design for failure. • Keep it logically awesome.

Slide 8

Slide 8 text

Let’s talk about Practicality

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

Technical scaling probably won’t be your problem.

Slide 12

Slide 12 text

Choose technology your team can rely on.

Slide 13

Slide 13 text

GitHub isn’t a Rails shop. It’s not even a Ruby shop. It’s a Unix shop. — @rtomayko “

Slide 14

Slide 14 text

Let’s talk about Performance

Slide 15

Slide 15 text

Event delegation $('.js-button').on 'click', -> …

Slide 16

Slide 16 text

Event delegation $(document).on 'click', '.js-button', -> …

Slide 17

Slide 17 text

Minimal SCSS

Slide 18

Slide 18 text

Let’s talk about Complexity

Slide 19

Slide 19 text

ViewModels

Slide 20

Slide 20 text

<% if current_user.invitations_enabled? && @team.pending_invitations.any? && @team.adminable_by?(current_user) %>

Pending invitations

<% @team.pending_invitations.each do |…| %> … <% end %> <% end %>

Slide 21

Slide 21 text

app/views/orgs/teams/show.html.erb app/view_models/orgs/teams/show_view.rb

Slide 22

Slide 22 text

class Teams::ShowView < ViewModel attr_reader :team def show_pending_invitations? current_user.invitations_enabled? && team.pending_invitations.any? && team.adminable_by?(current_user) end end

Slide 23

Slide 23 text

<% if view.show_pending_invitations? %>

Pending invitations

<% view.team.pending_invitations.each do |…| %> … <% end %> <% end %>

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

<% if current_repository.pushable_by?(current_user) %> <% if pull_request && pull_request.head_ref_deletable_by?(current_user) && branch != current_repository.default_branch %> <%= link_to "Delete branch", … %> <% end %> <% end %> <% if view.can_delete_branch? %> <%= link_to "Delete branch", … %> <% end %>

Slide 27

Slide 27 text

Feature flags

Slide 28

Slide 28 text

module FeatureFlags def preview_features? staff? end def new_thing_enabled? preview_features? end end

Slide 29

Slide 29 text

class User < ActiveRecord::Base include FeatureFlags end

Slide 30

Slide 30 text

class ApplicationController flags = FeatureFlags.public_instance_methods delegate *flags, to: current_user, allow_nil: true helper_method *flags end

Slide 31

Slide 31 text

<% if new_thing_enabled? %> … <% end %>

Slide 32

Slide 32 text

<% if new_thing_enabled? %> … <% else %> … <% end %>

Slide 33

Slide 33 text

class NewThingController < ApplicationController before_filter :ensure_new_thing_enabled def ensure_new_thing_enabled render_404 unless new_thing_enabled? end end

Slide 34

Slide 34 text

module FeatureFlags def preview_features? staff? end def new_thing_enabled? preview_features? end end ⁉️

Slide 35

Slide 35 text

module FeatureFlags def preview_features? staff? end def new_thing_enabled? preview_features? true end end ✨

Slide 36

Slide 36 text

jnunemaker / flipper !

Slide 37

Slide 37 text

Let’s talk about Tooling

Slide 38

Slide 38 text

peek / peek !

Slide 39

Slide 39 text

github / dat-science !

Slide 40

Slide 40 text

require "dat/science" class YourApp::Widget def allows?(user) experiment = Dat::Science::Experiment.new "widget-permissions" do |e| e.control { model.check_user(user).valid? } e.candidate { user.can? :read, model } end experiment.run end end

Slide 41

Slide 41 text

require "dat/science" class YourApp::Widget include Dat::Science def allows?(user) science "widget-permissions" do |e| e.control { model.check_user(user).valid? } e.candidate { user.can? :read, model } end end end

Slide 42

Slide 42 text

github / dat-analysis !

Slide 43

Slide 43 text

Let’s talk about Responsibility

Slide 44

Slide 44 text

class StarsController < … areas_of_responsibility :explore … end

Slide 45

Slide 45 text

class ReleasesController < … areas_of_responsibility :releases, :git … end

Slide 46

Slide 46 text

class BranchesController < … areas_of_responsibility :pull_requests, :repo_browsing, :web_flow, :git … end

Slide 47

Slide 47 text

--- # Areas of Responsibility in the github/github codebase 2fa: name: "Two-Factor Authentication" teams: - "@github/2fa" abilities: name: "Abilities" teams: - "@github/abilities" - "@github/abilibuddies" api: name: "API / OAuth" teams: - "@github/api" - "@github/oauth-of-tomorrow"

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

Lessons

Slide 50

Slide 50 text

Design faces inwards too.

Slide 51

Slide 51 text

Design cuts through the stack.

Slide 52

Slide 52 text

Learn to code, but don’t get hung up.

Slide 53

Slide 53 text

Learn to design, but don’t get hung up.

Slide 54

Slide 54 text

Thanks! @cobyism