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
PicoRubyと暮らす、シェアハウスハック
ryosk7
0
220
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
190
Alba: Why, How and What's So Interesting
okuramasafumi
0
210
ドメインイベント増えすぎ問題
h0r15h0
2
570
技術的負債と向き合うカイゼン活動を1年続けて分かった "持続可能" なプロダクト開発
yuichiro_serita
0
300
歴史と現在から考えるスケーラブルなソフトウェア開発のプラクティス
i10416
0
300
Azure AI Foundryのご紹介
qt_luigi
1
210
AWSのLambdaで PHPを動かす選択肢
rinchoku
2
390
責務を分離するための例外設計 - PHPカンファレンス 2024
kajitack
9
2.4k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
430
Запуск 1С:УХ в крупном энтерпрайзе: мечта и реальность ПМа
lamodatech
0
960
Rubyでつくるパケットキャプチャツール
ydah
0
170
Featured
See All Featured
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
Building Applications with DynamoDB
mza
93
6.2k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
The Language of Interfaces
destraynor
155
24k
Visualization
eitanlees
146
15k
Into the Great Unknown - MozCon
thekraken
34
1.6k
The Invisible Side of Design
smashingmag
299
50k
Fireside Chat
paigeccino
34
3.1k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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