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
ソフトウェアの振る舞いに着目し 複雑な要件の開発に立ち向かう
rickyban
0
890
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
280
CSC305 Lecture 25
javiergs
PRO
0
130
わたしの星のままで一番星になる ~ 出産を機にSIerからEC事業会社に転職した話 ~
kimura_m_29
0
170
Discord Bot with AI -for English learners-
xin9le
1
120
.NET 9アプリをCGIとして レンタルサーバーで動かす
mayuki
1
770
事業成長を爆速で進めてきたプロダクトエンジニアたちの成功談・失敗談
nealle
3
1.4k
103 Early Hints
sugi_0000
1
180
From Translations to Multi Dimension Entities
alexanderschranz
2
120
Recoilを剥がしている話
kirik
5
6.5k
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
160
今からはじめるAndroidアプリ開発 2024 / DevFest 2024
star_zero
0
990
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
17
2.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
5
440
The Pragmatic Product Professional
lauravandoore
32
6.3k
The Power of CSS Pseudo Elements
geoffreycrofte
73
5.4k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
Making Projects Easy
brettharned
116
5.9k
Designing for humans not robots
tammielis
250
25k
The Language of Interfaces
destraynor
154
24k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Building an army of robots
kneath
302
44k
Visualization
eitanlees
145
15k
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