View
173
Download
0
Category
Preview:
DESCRIPTION
An exploration of the forgotten and dusty corners of Ruby, including a tour of some very unusual behaviors from threads, loops, exceptions and procs. This is a technical deep dive into some obscure features of Ruby that may someday crawl out from under your bed, and when they do you'll be glad you were prepared for the fight.
Citation preview
I’m Jonanalso @1337807
I’m from Portland
They call me
Webmaster
Also New Relic
Ruby Monsters!
Oddities
Ruby is adorable
begin; endA neutral, hypoallergenic code wrapper made of opinions.
do while
ensureWhen you absolutely, probably, maybe need it done approximately right.
Thread#raise
“I don’t use Thread#raise.”
Net/HTTP
flip-flopWhen only the occasional truth will do.
(expr1)..(expr2)inclusive, evaluates both expressions on each pass
(expr1)…(expr2)exclusive, evaluates one expression per iteration
scopeLike voting districts for your code, with more gerrymandering.
closuresThey’re exactly like that one thing from that one language except sometimes when they’re not.
portable code podsbits of code that travel a lot, but never forget their roots.
blocks
Integer#times
procs
lambdas
blocks and procs- arbitrary arguments!- return home
lambdas- strict arguments!- local return
goto!
I’m Jonanalso @1337807
I’m from Portland
They call me
Webmaster
I work for New Relic
Ruby Monsters!
!
the end :)
Recommended