Skip to content

Instantly share code, notes, and snippets.

@evanphx
evanphx / fibo.rb
Created October 19, 2011 02:44
Fibonacci sequence in Ruby
require 'benchmark'
def fibo(n)
x,y = 0,1
n.times do
x,y = y,x+y
end
end
number = 100_000
# file1
namespace Yehuda
class String
def printout
puts self
end
end

Lessons Learned

Be Confident

Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.

Be Lazy