“programming is rather thankless.
you see your works
become replaced by
superior works in a year.
unable to run at all
in a few more.”
_why
Slide 11
Slide 11 text
“Here’s what becoming eFamous
made me realize:
Everyone is sincere and doing it
because they care. I was very
surprised to learn this.”
@garybernhardt
Slide 12
Slide 12 text
“I get paid to do something I love.
Something I’ve done in my spare
time since I was a kid. That’s
awesome. That’s why I care.”
@lindseybieda
Slide 13
Slide 13 text
I Care
Slide 14
Slide 14 text
Pleasant Surprises
net-http-persistent
single connection
~750,000 requests
Slide 15
Slide 15 text
Pleasant Surprises
rdoc -C
shows
documentation coverage
for your library
used in contracts
Slide 16
Slide 16 text
Values
Slide 17
Slide 17 text
Open Source Values
•Community
•Collaboration
•Sharing
•Re-use
Slide 18
Slide 18 text
Proprietary Software
“Your team should work
like an open source project”
bit.ly/1byoEiK
Ryan Tomayko
Slide 19
Slide 19 text
OSS Constraints
•Electronic Communication
•Visible Work
•Asynchronous
•Lock-free
Slide 20
Slide 20 text
Commits
Slide 21
Slide 21 text
Commits
Create
History
Slide 22
Slide 22 text
Tell
a Story
Slide 23
Slide 23 text
Commit Small
•History is easier to read
•Easy to revert
•Easy branch maintenance
•github user page bragging
Slide 24
Slide 24 text
Atomic Commit
Convention
bit.ly/160ia91
Slide 25
Slide 25 text
Small Commits
•Fix only one bug
•Add one method
•Whitespace cleanup
•Reformat a line
Slide 26
Slide 26 text
Current status:
Not sure where
I was going
with this
Slide 27
Slide 27 text
“One thing Clojure has
taught me is that good
commit messages are a
luxury of people that know
what the fuck they are doing”
@tpope
Slide 28
Slide 28 text
Be Descriptive
Descriptive messages
make history
easy to understand
Slide 29
Slide 29 text
git commit --help
“begin the commit message
with a single short line
summarizing the change”
Slide 30
Slide 30 text
Short Summary
•The URI argument to
Gem::Request.new must be a URI
•Only display relevant release notes
upon update
•Allow `gem uninstall foo --all`
Slide 31
Slide 31 text
git commit --help
“followed by
a more thorough
description”
Slide 32
Slide 32 text
Thorough Description
The URI argument to Gem::Request.new must be a
URI
The tests were lazy and used a String which was
converted internally.
This causes problems on older ruby versions which
don't allow `URI(URI("http://example"))`.
Now the argument given is always a URI in the tests.
Slide 33
Slide 33 text
Thorough Description
•Old behavior
•Why it needs to change
•New behavior
gzip Timestamp
•One second resolution
•Test gzipped two files
•Sometimes in different seconds
Slide 44
Slide 44 text
It's OK
to Be Wrong
Slide 45
Slide 45 text
rubygems/rubygems #510
them:
The chmod
should be included
in the publishing guide
Slide 46
Slide 46 text
rubygems/rubygems #510
me:
Why?
The file is created with
the correct permissions
Slide 47
Slide 47 text
rubygems/rubygems #510
them:
The guide says to run:
curl -u username [...] >
~/.gem/credentials
Slide 48
Slide 48 text
rubygems/rubygems #510
me:
I'm sorry, I didn't read that section.
RubyGems creates
the credentials file for you.
I'll rewrite the offending section.
Slide 49
Slide 49 text
Pursue
Understanding
Slide 50
Slide 50 text
“‘X’ is Hard to Use”
•“Hard”, “Broken”, “Doesn't Work”
•You think “X” is easy, works
•They might be right!
Slide 51
Slide 51 text
Maintenance &
New Features
Slide 52
Slide 52 text
Find the
Root Cause
Slide 53
Slide 53 text
“Trying to force myself to keep
asking, ‘rather than *solve*
[hard problem X], is there a
way to make [X] irrelevant?’
Typical answer: yes.”
Kathy Sierra — @seriouspony
Slide 54
Slide 54 text
Hard → Easy
•Hide details when possible
•Avoid configuration
•Provide broad defaults
Slide 55
Slide 55 text
pcaprub API
pcap =
Pcap.open_live 'wlan0', 65535, true, 0
pcap.setfilter 'icmp'
loop do
p pcap.next
end
Slide 56
Slide 56 text
capp
capp = Capp.live
capp.filter = 'icmp'
capp.loop do |packet|
p packet
end
Slide 57
Slide 57 text
“The worst thing about
writing clever code is not
being clever enough to
understand it.”
Eleanor McHugh — @feyeleanor
Slide 58
Slide 58 text
Keep it Simple
•Small commits
•Minimum change
•Document when you can't
Slide 59
Slide 59 text
rails/rails@ba0568e
“In the past we used
Hash[columns.zip(row)] […],
the verbose way is much more efficient
both time and memory wise
cause it avoids a big array allocation”
Slide 60
Slide 60 text
Refactor
•Simplify methods
•Improve API
•Improve understanding
•Don't forget tests
Slide 61
Slide 61 text
Good
API
Slide 62
Slide 62 text
Compact API
•Minimum objects
•Minimum arguments
•Minimum configuration
•Self-check through tests
Slide 63
Slide 63 text
Good Names
•Hardest
•Do your names fit?
•Reveal intention?
Slide 64
Slide 64 text
Semantic
Versioning
Slide 65
Slide 65 text
2.3.4
•Incompatible API changes
Slide 66
Slide 66 text
2.3.4
•Incompatible API changes
•Backward-compatible features
Slide 67
Slide 67 text
2.3.4
•Incompatible API changes
•Backward-compatible features
•Backward-compatible bug fixes
•http://semver.org
Slide 68
Slide 68 text
SemVer and RubyGems
'rake', '~> 10.0.3'
10.0.3 to 10.0.99…
Slide 69
Slide 69 text
SemVer and RubyGems
'rake', '~> 10.0',
'>= 10.0.3'
10.0.3 to 10.99…
Slide 70
Slide 70 text
Reduce
Barriers
Slide 71
Slide 71 text
“This is what your
tool chain looks
like to people not
‘in the know’.
They just want to
do a thing”
@jessenoller
Slide 72
Slide 72 text
How Do I Start?
•CONTRIBUTING.txt
•run: bundle
•How do I run the tests?
•hoe: rake newb