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
Complexity
Search
John Cinnamond
March 11, 2016
Programming
1
220
Complexity
A short talk about complexity, delivered at Bath Ruby 2016
John Cinnamond
March 11, 2016
Tweet
Share
More Decks by John Cinnamond
See All by John Cinnamond
Go Lift
jcinnamond
0
2k
Theory
jcinnamond
0
1.8k
The Point of Objects
jcinnamond
0
110
The Art of Code Review
jcinnamond
4
640
Other Decks in Programming
See All in Programming
盆栽転じて家具となる / Bonsai and Furnitures
aereal
0
1.9k
Fibonacci Function Gallery - Part 2
philipschwarz
PRO
0
210
ISUCON14感想戦で85万点まで頑張ってみた
ponyo877
1
590
Swiftコンパイラ超入門+async関数の仕組み
shiz
0
180
いりゃあせ、PHPカンファレンス名古屋2025 / Welcome to PHP Conference Nagoya 2025
ttskch
1
180
最近のVS Codeで気になるニュース 2025/01
74th
1
100
良いユニットテストを書こう
mototakatsu
11
3.6k
Azure AI Foundryのご紹介
qt_luigi
1
210
functionalなアプローチで動的要素を排除する
ryopeko
1
210
知られざるDMMデータエンジニアの生態 〜かつてツチノコと呼ばれし者〜
takaha4k
1
450
선언형 UI에서의 상태관리
l2hyunwoo
0
270
ChatGPT とつくる PHP で OS 実装
memory1994
PRO
3
190
Featured
See All Featured
Designing on Purpose - Digital PM Summit 2013
jponch
116
7.1k
Rails Girls Zürich Keynote
gr2m
94
13k
The Cost Of JavaScript in 2023
addyosmani
46
7.2k
The Invisible Side of Design
smashingmag
299
50k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
Done Done
chrislema
182
16k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
6
500
A Philosophy of Restraint
colly
203
16k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
How STYLIGHT went responsive
nonsquared
96
5.3k
How to Think Like a Performance Engineer
csswizardry
22
1.3k
Transcript
@jcinnamond Complexity
As a business
As a business I want A/B testing on the
homepage
As a business I want A/B testing on the
homepage Because business
GREAT!
There’s a GEM for that GREAT!
source 'https://rubygems.org' gem 'rails', '4.2.5.2' group :development, :test do gem
'byebug' end
source 'https://rubygems.org' gem 'rails', '4.2.5.2' group :development, :test do gem
'byebug' end gem 'ab-testing-because-business'
$ bundle install Using rake 10.5.0 Using rails 4.2.5.2 Installing
ab-testing-because-business Using node 6.0.1 Using vb.net 14.0 Using microsoft-iis 5.1
rails g ab-testing:init invoke ab_test_all_the_things modify app/views/homepage.html.erb convert_all_the_users $
rails g ab-testing:init invoke ab_test_all_the_things modify app/views/homepage.html.erb convert_all_the_users $ :shipit:
Everyone is happy
Everyone is happy Everything is EASY
As a user
As a user I want some copy changed
As a user I want some copy changed Because reasons
GREAT!
There’s a GEM for that GREAT!
source 'https://rubygems.org' gem 'rails', '4.2.5.2' gem 'ab-testing-because-business' group :development, :test
do gem 'byebug' end
source 'https://rubygems.org' gem 'rails', '4.2.5.2' gem 'ab-testing-because-business' group :development, :test
do gem 'byebug' end gem 'awesome-copy-change'
$ bundle install Using rake 10.5.0 Using peoples-front-of-judea 1.4.3 Using
judean-peoples-front 2.1.0 Using judean-popular-peoples-front 0.9 Using ab-testing-because-business 1.0 Installing awesome-copy-change 0.1 Using romanes-eunt-domus 1.0.0-beta3 A møøse once bit my sister…
AwesomeCopyChange.config do |config| change 'romanus eunt domus', to: 'romani ite
domum' end config/initializers/awesome_copy_change.rb
AwesomeCopyChange.config do |config| change 'romanus eunt domus', to: 'romani ite
domum' end config/initializers/awesome_copy_change.rb :shipit:
Everyone is happy
Everyone is happy Everything is EASY
47% of rails development is installing gems* * I totes
just made this up
$ grep -c '^\s*gem' Gemfile 40 $ bundle list |
grep -c '\*' 122
$ bundle install --path=vendor/bundle ...
$ bundle install --path=vendor/bundle ... $ find vendor/bundle/ruby/2.3.0/gems -name \*.rb
|
$ bundle install --path=vendor/bundle ... $ find vendor/bundle/ruby/2.3.0/gems -name \*.rb
| egrep -v 'spec|test' |
$ bundle install --path=vendor/bundle ... $ find vendor/bundle/ruby/2.3.0/gems -name \*.rb
| egrep -v 'spec|test' | wc -l
$ bundle install --path=vendor/bundle ... $ find vendor/bundle/ruby/2.3.0/gems -name \*.rb
| egrep -v 'spec|test' | wc -l 4234
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
xargs cat |
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
xargs cat | grep '^\s*def\b' |
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
xargs cat | grep '^\s*def\b' | wc -l
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
xargs cat | grep '^\s*def\b' | wc -l 35454 (methods)
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
xargs cat | grep '^\s*def method_missing\b' | wc -l 35454 (methods) 93 (method_missing)
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
xargs cat | grep '^\bdefine_method\b' | wc -l 35454 (methods) 93 (method_missing) 205 (define_method)
¯\_(ϑ)_/¯
$ find app -name '*.rb' | xargs cat | grep
-v '^\s*#' | grep -v '^\s*$' | wc -l 1007
$ find vendor/bundle/ruby/2.3.0/gems -name \*.rb | egrep -v 'spec|test' |
xargs cat | grep -v '^\s*#' | grep -v '^\s*$' | wc -l 377195
100% Our code Other people's code
0 100000 200000 300000 400000 Code that's been through our
PR process Code that hasn't
Projects get COMPLEX
Rails projects get COMPLEXERERER
GEMS aren't the problem
Solve problems by DOING STUFF
Solve problems by DOING STUFF Adding a gem
Solve problems by DOING STUFF Adding a gem Running scripts
Solve problems by DOING STUFF Adding a gem Running scripts
Writing code
Solve problems by DOING STUFF Adding a gem Running scripts
Writing code ADDING COMPLEXITY
COMPLEXITY KILLS PROJECTS
Avoid complexity by
Avoid complexity by DOING LESS STUFF
Avoid complexity by DOING LESS STUFF THINKING MORE
Avoid complexity by DOING LESS STUFF THINKING MORE CARING MORE
This takes time
Nobody is happy
Nobody is happy Nothing is EASY
AVOIDING COMPLEXITY isn't always the right thing
But it's about balance
COMPLEXITY KILLS PROJECTS
COMPLEXITY KILLS PROJECTS nobody likes a dead project
Great! There's a gem for this
I can bash out out some code
maybe don't think that I can bash out out
some code
try thinking about the problem I can bash
out out some code
try to find the SIMPLE solution I can bash
out out some code
IN THE SHORT TERM nobody cares
IN THE LONG TERM your project depends on it
Thank you Complexity @jcinnamond Bath Ruby 2016