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
40
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
15
Victims of Complexity
bbatsov
0
310
Ruby 3.0 Redux (Spark Academy, Jan 2021)
bbatsov
1
250
Ruby 3.0 Redux (Pivorak 4.0)
bbatsov
0
450
The Elements of Programming Style (HackConf 2019)
bbatsov
0
170
The Groundhog Day Development Method (HackConf 2019)
bbatsov
0
270
Other Decks in Programming
See All in Programming
衛星の軌道をWeb地図上に表示する
sankichi92
0
260
Your Architecture as a Crime Scene:Forensic Analysis
manfredsteyer
PRO
0
100
RubyKaigiで得られる10の価値 〜Ruby話を聞くことだけが RubyKaigiじゃない〜
tomohiko9090
0
130
Javaに鉄道指向プログラミング (Railway Oriented Pro gramming) のエッセンスを取り入れる/Bringing the Essence of Railway-Oriented Programming to Java
cocet33000
2
510
Devinで実践する!AIエージェントと協働する開発組織の作り方
masahiro_nishimi
6
2.9k
Use Perl as Better Shell Script
karupanerura
0
680
Perlで痩せる
yuukis
1
680
20250528 AWS Startupイベント登壇資料:AIコーディングの取り組み
procrustes5
0
160
KotlinConf 2025 現地で感じたServer-Side Kotlin
n_takehata
1
170
社内での開発コミュニティ活動とモジュラーモノリス標準化事例のご紹介/xPalette and Introduction of Modular monolith standardization
m4maruyama
0
110
FormFlow - Build Stunning Multistep Forms
yceruto
1
150
Practical Tips and Tricks for Working with Compose Multiplatform Previews (mDevCamp 2025)
stewemetal
0
120
Featured
See All Featured
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
14
1.5k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Faster Mobile Websites
deanohume
307
31k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
42
2.4k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
10
890
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
Automating Front-end Workflow
addyosmani
1370
200k
How GitHub (no longer) Works
holman
314
140k
Documentation Writing (for coders)
carmenintech
71
4.9k
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