161
So You Want to Teach Ruby and Rails... Bryan Bibat

So You Want to Teach Ruby and Rails

Embed Size (px)

DESCRIPTION

My RubyConfPH 2014 talk on how to introduce intermediate-level web development to newbies.

Citation preview

Page 1: So You Want to Teach Ruby and Rails

So You Want to TeachRuby and Rails...

Bryan Bibat

Page 2: So You Want to Teach Ruby and Rails
Page 3: So You Want to Teach Ruby and Rails
Page 4: So You Want to Teach Ruby and Rails
Page 5: So You Want to Teach Ruby and Rails
Page 6: So You Want to Teach Ruby and Rails
Page 7: So You Want to Teach Ruby and Rails

So You Want to TeachRuby and Rails...

Bryan Bibat

Page 8: So You Want to Teach Ruby and Rails
Page 9: So You Want to Teach Ruby and Rails

Not as easy as it looks...

Page 10: So You Want to Teach Ruby and Rails

You have to take many things into account in order to be an

effective teacher.

Page 11: So You Want to Teach Ruby and Rails

Unfortunately, I only have 30 minutesso I'll just cover the main points.

Page 12: So You Want to Teach Ruby and Rails

0. Students

Page 13: So You Want to Teach Ruby and Rails

1. Domain

Page 14: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

Page 15: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

Page 16: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

Page 17: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

Page 18: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

Page 19: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

Page 20: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

Page 21: So You Want to Teach Ruby and Rails

Web Development Knowledge Layersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 22: So You Want to Teach Ruby and Rails

Rails is an intermediate-level toolin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 23: So You Want to Teach Ruby and Rails

Rails is an intermediate-level toolin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 24: So You Want to Teach Ruby and Rails

1. Domain

Page 25: So You Want to Teach Ruby and Rails

0. Students

1. Domain

Page 26: So You Want to Teach Ruby and Rails

Beginners

Page 27: So You Want to Teach Ruby and Rails

True Beginner

Page 28: So You Want to Teach Ruby and Rails

True Beginnerin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 29: So You Want to Teach Ruby and Rails

True Beginnerin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 30: So You Want to Teach Ruby and Rails

True Beginnerin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 31: So You Want to Teach Ruby and Rails

Ruby is great for True Beginnersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 32: So You Want to Teach Ruby and Rails

Rails is notin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 33: So You Want to Teach Ruby and Rails

Web Beginner

Page 34: So You Want to Teach Ruby and Rails

Web Beginnerin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 35: So You Want to Teach Ruby and Rails

Web Beginnerin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 36: So You Want to Teach Ruby and Rails

Veteran

Page 37: So You Want to Teach Ruby and Rails

Veteran Web

Page 38: So You Want to Teach Ruby and Rails

Veteran Webin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 39: So You Want to Teach Ruby and Rails

Veteran Webin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 40: So You Want to Teach Ruby and Rails

Veteran Webin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 41: So You Want to Teach Ruby and Rails

Ninja

Page 42: So You Want to Teach Ruby and Rails

Polyglot / Full Stack Developer

Page 43: So You Want to Teach Ruby and Rails

Polyglotin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 44: So You Want to Teach Ruby and Rails

Polyglotin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 45: So You Want to Teach Ruby and Rails

When I started Rails...

Page 46: So You Want to Teach Ruby and Rails

me c.2009 - Veteran Webin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 47: So You Want to Teach Ruby and Rails

me c.2009 - Veteran Webin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 48: So You Want to Teach Ruby and Rails

me c.2009 - Veteran Webin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 49: So You Want to Teach Ruby and Rails

me c.2009 - Veteran Webin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 50: So You Want to Teach Ruby and Rails

Migrations

class CreateUsers < ActiveRecord::Migration def self.up create_table :users do |t| t.string :email t.string :password t.string :crypted_password t.string :password_salt t.string :persistence_token t.timestamps end end def self.down drop_table :users endend

Page 51: So You Want to Teach Ruby and Rails

Migrationsin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 52: So You Want to Teach Ruby and Rails

Migrationsin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 53: So You Want to Teach Ruby and Rails

Migrations made sense to me.

Page 54: So You Want to Teach Ruby and Rails
Page 55: So You Want to Teach Ruby and Rails

Migrations

mind = blown

Page 56: So You Want to Teach Ruby and Rails

Migrations - experience overlapin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 57: So You Want to Teach Ruby and Rails

now compare this with newbies'...

Page 58: So You Want to Teach Ruby and Rails

Migrationsin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 59: So You Want to Teach Ruby and Rails

Migrations - WTF?!?in

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 60: So You Want to Teach Ruby and Rails

Migrations

Page 61: So You Want to Teach Ruby and Rails

MigrationsRouting

ActiveRecordConvention over Configuration

Test Driven Development

Page 62: So You Want to Teach Ruby and Rails

MigrationsRouting

ActiveRecordConvention over Configuration

Test Driven DevelopmentRuby Idioms

Higher Order Functions

Page 63: So You Want to Teach Ruby and Rails

MigrationsRouting

ActiveRecordConvention over Configuration

Test Driven DevelopmentRuby Idioms

Higher Order FunctionsAsset Pipeline

TurbolinksDevOps

Page 64: So You Want to Teach Ruby and Rails

Wow

such migrations

much unit tests

very omakaserailz so amaze

@doge ||= 9000

so turbolinks

so restful

Page 65: So You Want to Teach Ruby and Rails

Wow

such migrations

much unit tests

very omakaserailz so amaze

@doge ||= 9000

so turbolinks

so restfulscrew this, I'm going back to [language]

Page 66: So You Want to Teach Ruby and Rails

You have to bridge the gapin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 67: So You Want to Teach Ruby and Rails

2. Purpose

Page 68: So You Want to Teach Ruby and Rails

To understand how our students think,we must first ask ourselves:

Why are we here?

Page 69: So You Want to Teach Ruby and Rails

To understand how our students think,we must first ask ourselves:

Why are we here?

How did it come to this?

Page 70: So You Want to Teach Ruby and Rails

The Hype Cycle

Image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 71: So You Want to Teach Ruby and Rails

But there are other hype cycles...

original image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 72: So You Want to Teach Ruby and Rails

Also the technology is far from perfect...

Page 73: So You Want to Teach Ruby and Rails

Ruby - a multi-paradigm scripting language

Page 74: So You Want to Teach Ruby and Rails

Ruby...● is slow● is memory intensive● developers are hard to find● has all the cons of a dynamically typed language

Page 75: So You Want to Teach Ruby and Rails

Ruby on Rails - an MVC framework

Page 76: So You Want to Teach Ruby and Rails

Rails...● is huge and bloated● has magical abstractions● is hard to deploy

Page 77: So You Want to Teach Ruby and Rails

So why?

Page 78: So You Want to Teach Ruby and Rails

It's not the technologybut the way of thinking

Page 79: So You Want to Teach Ruby and Rails

History of Web Languages/Platformsup to mid-00s

Page 80: So You Want to Teach Ruby and Rails

CGI/Perl scripting →

Page 81: So You Want to Teach Ruby and Rails

CGI/Perl scripting →

Compiled Language (Java, C#)Templating Language (PHP)

Page 82: So You Want to Teach Ruby and Rails

CGI/Perl scripting →

Compiled Language (Java, C#)Templating Language (PHP)

→ Object/Functional Scripting as an option

Page 83: So You Want to Teach Ruby and Rails

● is slow● is memory intensive● developers are hard to find● has all the cons of a dynamically typed language

BUT ALSO

● expressive● functional, OO, with metaprogramming● developers examples of the Python Paradox● has all the pros of a dynamically typed language

Page 84: So You Want to Teach Ruby and Rails

History of Web Applicationsup to mid-00s

Page 85: So You Want to Teach Ruby and Rails

big ball of mud →

Page 86: So You Want to Teach Ruby and Rails

big ball of mud →

over-designed frameworks

Page 87: So You Want to Teach Ruby and Rails

big ball of mud →

over-designed frameworks

→ a compromise

Page 88: So You Want to Teach Ruby and Rails

● is huge and bloated● has magical abstractions● is hard to deploy

BUT ALSO

● a decent package of design patterns● good for prototyping ie. has a good amount of

features built-in while being extensible● continuously improving along recent trends

Page 89: So You Want to Teach Ruby and Rails

A way of thinking that worked

Page 90: So You Want to Teach Ruby and Rails

AND...

Page 91: So You Want to Teach Ruby and Rails

It took advantage of the hype cycle.

original image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 92: So You Want to Teach Ruby and Rails

It took advantage of the hype cycle.

original image: http://en.wikipedia.org/wiki/User:Jeremykemp

One of the first to use it successfullyto achieve critical mass

Page 93: So You Want to Teach Ruby and Rails

history lesson over...

Page 94: So You Want to Teach Ruby and Rails

2. Purpose

Page 95: So You Want to Teach Ruby and Rails

0. Students

Page 96: So You Want to Teach Ruby and Rails

The HYPE is what got us in...

Image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 97: So You Want to Teach Ruby and Rails

The HYPE is what got us in...

Image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 98: So You Want to Teach Ruby and Rails

The HYPE is what got us in...

Image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 99: So You Want to Teach Ruby and Rails

...but the HYPE is also what keeps newbies out.

Image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 100: So You Want to Teach Ruby and Rails

Image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 101: So You Want to Teach Ruby and Rails

Expectations are not met.

Image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 102: So You Want to Teach Ruby and Rails

Manage Expectations

Page 103: So You Want to Teach Ruby and Rails

● is slow● is memory intensive● developers are hard to find● has all the cons of a dynamically typed language

BUT ALSO

● expressive● functional, OO, with metaprogramming● developers examples of the Python Paradox● has all the pros of a dynamically typed language

Page 104: So You Want to Teach Ruby and Rails

● is huge and bloated● has magical abstractions● is hard to deploy

BUT ALSO

● a decent package of design patterns● good for prototyping ie. has a good amount of

features built-in while being extensible● continuously improving along recent trends

Page 105: So You Want to Teach Ruby and Rails

Don't stop explainingin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 106: So You Want to Teach Ruby and Rails

3. Retention

Page 107: So You Want to Teach Ruby and Rails

Tailor your course according to the students you wish to teach

Page 108: So You Want to Teach Ruby and Rails

Veterans need only a little pushin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 109: So You Want to Teach Ruby and Rails

Of course, teaching beginners is hardin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 110: So You Want to Teach Ruby and Rails

Especially total beginnersin

crea

sin

g c

om

ple

xity

PR

ESE

NT

AT

ION

AP

PLI

CA

TIO

N

DA

TA

INFR

AST

RU

CT

UR

E

EN

GIN

EE

RIN

G

PR

AC

TIC

E

Page 111: So You Want to Teach Ruby and Rails

One-day workshops will not cut it.

You'll need to use some techniques for them to continue learning on their own.

Page 112: So You Want to Teach Ruby and Rails

One technique that people often misuse:

Page 113: So You Want to Teach Ruby and Rails

rails generate scaffold

Page 114: So You Want to Teach Ruby and Rails

rails generate scaffold

Page 115: So You Want to Teach Ruby and Rails

rails generate scaffold

● gives students a "taste of power", piquing their interest

Page 116: So You Want to Teach Ruby and Rails

rails generate scaffold

● gives students a "taste of power", piquing their interest● produces good sample code (esp. tests) for future study

Page 117: So You Want to Teach Ruby and Rails

rails generate scaffold

● gives students a "taste of power", piquing their interest● produces good sample code (esp. tests) for future study

● many students (and workshops) don't go past it

Page 118: So You Want to Teach Ruby and Rails

Wow

such migrations

much unit tests

very omakaserailz so amaze

@doge ||= 9000

so turbolinks

so restful

Page 119: So You Want to Teach Ruby and Rails

rails generate scaffold

● gives students a "taste of power", piquing their interest● produces good sample code (esp. tests) for future study

● many students (and workshops) don't go past it● in turn, it gives others the wrong impression

Page 120: So You Want to Teach Ruby and Rails

rails generate scaffold

● gives students a "taste of power", piquing their interest● produces good sample code (esp. tests) for future study

● many students (and workshops) don't go past it● in turn, it gives others the wrong impression

"Rails? Oh, that's just scaffolding scripts."

Page 121: So You Want to Teach Ruby and Rails

Follow through

Page 122: So You Want to Teach Ruby and Rails

Give them a road map

http://techiferous.com/2010/07/roadmap-for-learning-rails/

Page 123: So You Want to Teach Ruby and Rails

Let them try things on their own pace

Page 124: So You Want to Teach Ruby and Rails
Page 125: So You Want to Teach Ruby and Rails

and this also leads us to the last point...

Page 126: So You Want to Teach Ruby and Rails

4. Culture

Page 127: So You Want to Teach Ruby and Rails

Wow

such migrations

much unit tests

very omakaserailz so amaze

@doge ||= 9000

so turbolinks

so restful

Page 128: So You Want to Teach Ruby and Rails

original image: http://en.wikipedia.org/wiki/User:Jeremykemp

Page 129: So You Want to Teach Ruby and Rails
Page 130: So You Want to Teach Ruby and Rails

Polyglot / Full Stack Developer

Page 131: So You Want to Teach Ruby and Rails

Constantly Improving

http://blog.newrelic.com/2013/10/10/infographic-state-stack-ruby-edition/

Page 132: So You Want to Teach Ruby and Rails

Sharing Knowledge

Page 133: So You Want to Teach Ruby and Rails
Page 134: So You Want to Teach Ruby and Rails
Page 135: So You Want to Teach Ruby and Rails
Page 136: So You Want to Teach Ruby and Rails
Page 137: So You Want to Teach Ruby and Rails

On the other hand...

Page 138: So You Want to Teach Ruby and Rails

Myopia

Page 139: So You Want to Teach Ruby and Rails

most obvious:

Page 140: So You Want to Teach Ruby and Rails

You need to accept that most of your trainees will be Windows

users...

Page 141: So You Want to Teach Ruby and Rails
Page 142: So You Want to Teach Ruby and Rails

...so give them a clear path for migrating to *nixie. not just "Get a Mac!"

Page 143: So You Want to Teach Ruby and Rails

and other stuff in the culture that may turn off interested developers...

Page 144: So You Want to Teach Ruby and Rails

and other stuff in the culture that may turn off interested developers...

Page 145: So You Want to Teach Ruby and Rails

tl;dr:You have to introduce them to the culture.

Page 146: So You Want to Teach Ruby and Rails

In closing...

Page 147: So You Want to Teach Ruby and Rails

1. Domain

Page 148: So You Want to Teach Ruby and Rails

2. Purpose

Page 149: So You Want to Teach Ruby and Rails

3. Retention

Page 150: So You Want to Teach Ruby and Rails

4. Culture

Page 151: So You Want to Teach Ruby and Rails

0. Students

Page 152: So You Want to Teach Ruby and Rails

( °□°)╯ ╯︵

Or you could just teach Ruby

Page 153: So You Want to Teach Ruby and Rails
Page 154: So You Want to Teach Ruby and Rails
Page 155: So You Want to Teach Ruby and Rails
Page 156: So You Want to Teach Ruby and Rails
Page 157: So You Want to Teach Ruby and Rails
Page 158: So You Want to Teach Ruby and Rails
Page 159: So You Want to Teach Ruby and Rails
Page 160: So You Want to Teach Ruby and Rails
Page 161: So You Want to Teach Ruby and Rails

Thank you for listening!

bryanbibat.net | @bry_bibatspeakerdeck.com/bryanbibat