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
630
Other Decks in Programming
See All in Programming
Dev ContainersとGitHub Codespacesの素敵な関係
ymd65536
1
140
Better Code Design in PHP
afilina
PRO
0
120
AWS IaCの注目アップデート 2024年10月版
konokenj
3
3.3k
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
160
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
4
760
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
Quine, Polyglot, 良いコード
qnighy
4
630
CSC509 Lecture 09
javiergs
PRO
0
140
RubyLSPのマルチバイト文字対応
notfounds
0
100
From Subtype Polymorphism To Typeclass-based Ad hoc Polymorphism- An Example
philipschwarz
PRO
0
200
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
10
1.2k
Why Jakarta EE Matters to Spring - and Vice Versa
ivargrimstad
0
720
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
400
Documentation Writing (for coders)
carmenintech
65
4.4k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
700
Bash Introduction
62gerente
608
210k
Measuring & Analyzing Core Web Vitals
bluesmoon
3
78
Teambox: Starting and Learning
jrom
133
8.8k
GraphQLとの向き合い方2022年版
quramy
43
13k
How to Think Like a Performance Engineer
csswizardry
20
1.1k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
A designer walks into a library…
pauljervisheath
202
24k
Into the Great Unknown - MozCon
thekraken
32
1.5k
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