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
競技プログラミングへのお誘い@阪大BOOSTセミナー
kotamanegi
0
330
テスト自動化失敗から再挑戦しチームにオーナーシップを委譲した話/STAC2024 macho
ma_cho29
1
1.2k
CSC305 Lecture 26
javiergs
PRO
0
130
testcontainers のススメ
sgash708
1
110
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
17年周年のWebアプリケーションにTanStack Queryを導入する / Implementing TanStack Query in a 17th Anniversary Web Application
saitolume
0
240
fs2-io を試してたらバグを見つけて直した話
chencmd
0
150
KubeCon + CloudNativeCon NA 2024 Overviewat Kubernetes Meetup Tokyo #68 / amsy810_k8sjp68
masayaaoyama
0
230
Discord Bot with AI -for English learners-
xin9le
1
120
MCP with Cloudflare Workers
yusukebe
2
200
RWC 2024 DICOM & ISO/IEC 2022
m_seki
0
190
「Chatwork」Android版アプリを 支える単体テストの現在
okuzawats
0
170
Featured
See All Featured
Statistics for Hackers
jakevdp
796
220k
Practical Orchestrator
shlominoach
186
10k
4 Signs Your Business is Dying
shpigford
181
21k
How to train your dragon (web standard)
notwaldorf
88
5.7k
For a Future-Friendly Web
brad_frost
175
9.4k
Intergalactic Javascript Robots from Outer Space
tanoku
270
27k
Making the Leap to Tech Lead
cromwellryan
133
9k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Site-Speed That Sticks
csswizardry
1
180
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Done Done
chrislema
181
16k
Six Lessons from altMBA
skipperchong
27
3.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