Practice techniques in other crafts
David Chelimsky
November 19, 2011
SCNA
David Chelimsky
November 19, 2011
SCNA
any of the traditional forms of Oriental self-defense or combat that utilize physical skill and coordination without weapons, as karate, aikido, judo, or kung fu, often practiced as sport.
Marshall artist, I am not
Music (grade school)
Magic (middle school and high school)
Theatre (high school and college)
Music (college and beyond)
Software (much later)
Improvisation is the art of using existing tools, skills and experience to spontaneously create something relevant to the current context.
We improvise when we converse - using words, grammar and common idioms to convey ideas. We improvise in music by using scales, chords and common idioms to (one might argue) convey ideas.
We improvise in software in the same way. There are many ways to express an idea in software, and so we tap into our tools, skills and experience to express the idea in the way that is most relevant to the context.
Improvisation in software
David Chelimsky
November 19, 2011
SCNA
Musicians spend most of their careers practicing.
Software developers spend most of their careers performing.
... it definitely is the most important thing to be able to have great technique, because if you don’t have good technique, you can’t execute what’s in your head. What good is that?
It never seemed to make sense to me why you'd be playing a scale up and down when you could be playing a tune.
I listen to [John] Coltrane, Joe Henderson, Sonny Rollins
Mediterranean Sundance - solo by Al Di Meola (0:50)
Third Wind - solo by Pat Metheny (1:16)
Nothing Personal - solo by Michael Brecker (2:23)
156 problems to choose from
No primitives | Two line method max | Functional | etc | |
Conway | ||||
Bowling | ||||
Codebreaker | ||||
English Numerals | ||||
etc |
Work through a single problem applying different constraints each time.
Work through multiple problems applying the same constraint to each.
describe Game do it "scores 0 for a gutter game" do game = Game.new 20.times { game.roll(0) } game.score.should eq(0) end end class Game def initialize @rolls = [] end def roll(pins) @rolls << pins end def score # ...
def score score = 0 index = 0 10.times do if strike_at?(index) score += 10 + bonus_for_strike_at(index) elsif spare_at?(index) score += 10 + bonus_for_spare_at(index) else score += two_rolls_at(index) end index += 2 end score end
describe "bowling" do it "scores 0 for a gutter game" do game = make_game 20.times { roll(game, 0) } score(game).should eq(0) end end
def make_game; [] end def roll(game, pins); game << pins end def score(game) frames(game).map(&:score).sum end def frames(rolls, frame=0) return [] if frame == 10 next_frame(rolls, score_size(rolls)) + frames(rolls.drop(frame_size(rolls)), frame + 1) end
def next_frame(rolls, score_size) [rolls.take(score_size)] end def strike?(rolls); rolls.sum(1) == 10 end def spare?(rolls); rolls.sum(2) == 10 end def score_size(rolls) strike?(rolls) || spare?(rolls) ? 3 : 2 end def frame_size(rolls) strike?(rolls) ? 1 : 2 end
class Array.send :include, Module.new { def sum(n=size, &block) block ? map(&block).sum : take(n).inject(0, :+) end alias_method :score, :sum }
def score @rolls.inject {|sum,pins| sum + pins} end
def score score = 0 index = 0 10.times do if spare_at?(index) score += 10 + bonus_for_spare_at(index) else score += two_rolls_at(index) end index += 2 end score end