Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
The Master Rubyist
Search
Bozhidar Batsov
June 07, 2016
Programming
1
440
The Master Rubyist
Slide deck from my RubyC 2016 presentation.
Bozhidar Batsov
June 07, 2016
Tweet
Share
More Decks by Bozhidar Batsov
See All by Bozhidar Batsov
Clojure: The Bad Parts
bbatsov
0
44
Weird Ruby (RubyDay 2024, Verona)
bbatsov
0
140
Sustainable OSS (Balkan Ruby 2024, Sofia)
bbatsov
0
140
Ruby's Creed (RubyDay 2023, Verona)
bbatsov
0
18
Victims of Complexity
bbatsov
0
310
Ruby 3.0 Redux (Spark Academy, Jan 2021)
bbatsov
1
260
Ruby 3.0 Redux (Pivorak 4.0)
bbatsov
0
450
The Elements of Programming Style (HackConf 2019)
bbatsov
0
180
The Groundhog Day Development Method (HackConf 2019)
bbatsov
0
280
Other Decks in Programming
See All in Programming
ペアプロ × 生成AI 現場での実践と課題について / generative-ai-in-pair-programming
codmoninc
1
16k
Code as Context 〜 1にコードで 2にリンタ 34がなくて 5にルール? 〜
yodakeisuke
0
120
A full stack side project webapp all in Kotlin (KotlinConf 2025)
dankim
0
110
Team operations that are not burdened by SRE
kazatohiei
1
310
スタートアップの急成長を支えるプラットフォームエンジニアリングと組織戦略
sutochin26
1
4.7k
AIプログラマーDevinは PHPerの夢を見るか?
shinyasaita
1
210
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
350
0626 Findy Product Manager LT Night_高田スライド_speaker deck用
mana_takada
0
160
「テストは愚直&&網羅的に書くほどよい」という誤解 / Test Smarter, Not Harder
munetoshi
0
150
GraphRAGの仕組みまるわかり
tosuri13
8
530
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
760
関数型まつりレポート for JuliaTokai #22
antimon2
0
160
Featured
See All Featured
A better future with KSS
kneath
239
17k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
281
13k
The Invisible Side of Design
smashingmag
301
51k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Become a Pro
speakerdeck
PRO
28
5.4k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
How to train your dragon (web standard)
notwaldorf
94
6.1k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Transcript
None
Божидар
@bbatsov
I’m back
epic fail
None
Hakuna Matata, what a wonderful phrase Hakuna Matata, ain't no
passing craze It means no worries for the rest of your days It's our problem free philosophy, Hakuna Matata
They call me Master…
… and I’m a Rubyist
I must be The Master Rubyist!
None
Sofia, Bulgaria
Sofia, Bulgaria
None
Tarnovo, Bulgaria
None
None
None
Dashingly handsome
Sings like an angel
Loves karaoke
Is very responsible
Was very responsible last night
Loves beer
Loves scotch
Loves vodka
Terrified by gorilka
Loves Ruby
Loves Ruby
Loves Ruby
Loves Ruby
Uses tabs instead of spaces
Uses vim
None
Emacs fanatic
Star Wars fanatic
Batman
None
Loves OSS
Does some OSS development
None
On the core team of some projects
Works for a famous company
None
Loved by his team
None
Loved by his team
The Master Rubyist D[$Q\JKFCT$CVUQX
Master
having or showing very great skill or proficiency
None
Novice
a person new to and inexperienced in a job or
situation
None
Journeyman
a worker, performer, or athlete who is experienced and good
but not excellent
None
The Road to Mastery
None
not really
try 10 years
http://norvig.com/21- days.html Teach Yourself Programming in Ten Years Peter Norvig
Apprenticeship
Novice Journeyman Master Apprenticeship Apprenticeship
Object-oriented programming
None
Ruby is a purely object- oriented language
None
None
Know Thy Language!
Crazy People
None
Ruby is a VERY COMPLEX language!
class instance variable
protected
module_function vs extend self
refinements
super vs super()
== === equal? eql?
None
None
Grokking the language
Understanding and appreciating its philosophy
Coming to grips with reality
(no language is perfect)
(not even Clojure)
(some languages really suck)
Master the idioms
for i in 1..3 puts "Hello, Kiev!" end
3.times do puts "Hello, Kiev!" end
if some_condition then # body omitted end
def some_method # ... return result end
None
None
None
Read some (good) code
some == A LOT
None
Obtain a notion of style
A style guide • a curated set of (supposedly) good
practices • spares you the process of making trivial decisions • allows you to focus on the actual problems • simple and concise
None
Use the active voice.
My first visit to Kiev will always be remembered by
me. lame
I shall always remember my first visit to Kiev. legit
The word personally is often unnecessary.
Personally, I love RubyC.
Style guides aren’t a replacement for thinking
None
Write clearly -- don't be too clever.
def user_signed_in? !!@current_user end def user_signed_in? !@current_user.nil? end
Don't sacrifice clarity for small gains in efficiency.
i = 1 res = 0 while i <= 10
res += i i += 1 end
(1..10).reduce(:+)
(N * (N + 1)) / 2
(10 * (10 + 1)) / 2
Ruby Style Guide https://github.com/bbatsov/ruby-style-guide
None
Tackle problems with style
None
puts debugging sucks
bla bla bla puts ‘********’ puts x puts ‘********’
None
pro “puts” debugging techniques
object = Object.new puts object.method(:blank?).source_location # => ["/gems/ activesupport-5.0.0.beta1/lib/ active_support/core_ext/object/
blank.rb", 14]
class Bar def foo puts "=====================" puts caller end end
def foo puts method(:foo).super_method.source_location super end
def parse(input, skip_code_comments: false, ignore_whitespace: true) # do stuff end
method(:parse).parameters #=> [[:req, :input], [:key, :skip_code_comments], [:key, :ignore_whitespace]]
config.thing = { "foo" => "bar" } config.thing.freeze = {
"foo" => "bar" } config.thing.delete("foo") # active_support/concurrency/share_lock.rb:151:in `delete': can't modify frozen Hash (RuntimeError) # from active_support/concurrency/share_lock.rb:151:in `yield_shares' # from active_support/concurrency/share_lock.rb:79:in `block in stop_exclusive'
Ruby Debugging Magic Cheat Sheet http://www.schneems.com/2016/01/25/ruby-debugging- magic-cheat-sheet.html
I am a puts debugger https://tenderlovemaking.com/2016/02/05/i-am-a-puts- debuggerer.html
I am not a puts debugger!
byebug https://github.com/deivid-rodriguez/byebug
pry-byebug https://github.com/deivid-rodriguez/pry-byebug
Profiling stuff
ruby-prof https://github.com/ruby-prof/ruby-prof
memory_profiler https://github.com/SamSaffron/memory_profiler
The Editors
Emacs
vim
Spacemacs
What about the rest?
None
Emacs & vim are forever!
None
None
Interactive programming
The REPL is king!
pry > irb
Rails
None
Beyond Rails
Opal
RubyMotion
System administration
JRuby
Alternative web frameworks
Volt
Hanami
Padrino
Sinatra
Roda
Keep in sync
RubyWeekly
Ruby5
RubyRogues
RubyTapas
GoRails
RubyConf
RailsConf
Always be exploring!
Clojure
Haskell
Elm
Erlang/Elixir
Racket
Ideas from other programming languages make us better programmers
One more thing…
Ruby is simply not a good fit for every possible
problem
None
None
Felina