software composition by @steveklabnik
TRANSCRIPT
by @steveklabnik
Software Composition
Who?
Who?
Who?
Who?
“Best Practices”
•Use descriptive variable names
•Add whitespace for clarity
•Use object orientation properly
•Write comments
Alas, poor Yorick! I knew him, Horatio, a fellow of infinite jest, of most excellent fancy. He has bore me on his back a thousand times, and now how abhorr'd in my imagination it is!
Software Composition:
Software Composition:
The Multitude of Audiences
Software Composition:
The Multitude of Audiences
The Multiplicity of Forms
Software Composition:
The Multitude of Audiences
The Multiplicity of Forms
An Aside: Literacy Crisis
The Multitude of Audiences
The Default Audience:The Computer
Science is what we understand well enough to explain to a computer. Art is everything else we do.•Don Knuth
The Reflexive Audience:The programmer
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.•Brian Kernighan
The ‘Other’ Audience:Colleagues and Coworkers
Always code as if the guy who ends up maintaining your code is a violent psychopath who knows where you live.•Martin Golding
The forgotten audience:end-users
If I asked my customers what they wanted, they'd have told me, "A faster horse."•Henry Ford
The Multiplicity of Forms
Source`Twas brillig, and the slithy toves Did gyre and gimble in the wabe:All mimsy were the borogoves, And the mome raths outgrabe.- Jabberwocky
puts <<2*2,2puts <<2*2,22
v=0000;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC "%.#% :::##" 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B "##% ::##########" O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? "##: ###############" g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W "# #. .####:#######" lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. " ##### # :############" R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 " #######################" 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ " ############:#### %#####" EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q " .#############:##% .## ." /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; " %% .################. #. " ;s="v=%04o;ev"%(;v=(v-($*+[45, ":####: :##############% : " ])[n=0].to_i;)%360)+"al$s=%q#{ "%######. ######### " ;;"%c"%126+$s<<126}";d.gsub!(/ "##########. #######% " |\s|".*"/,"");;require"zlib"|| "########### :######. " ;d=d.unpack"C*"d.map{|c|n=(n|| ":#########: .######: . " )*90+(c-2)%91};e=["%x"%n].pack " :#######% :###### #: " &&"H*";e=Zlib::Inflate.inflate( " ######% .####% :: " &&e).unpack("b*")[0];22.times{|y| " ####% %### " ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; " .###: .#% " ;2))*23).floor;(w*2-1).times{|x|u=(e+ " %## " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " #. " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " . " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( "# :#######" ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0416;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC ".#####%.#% " 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B " .#####%##% :" O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? " #####%###: #" g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W " %######## #." lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. " :####### ###" R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 " ###: : ####" 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ " %#... #####" EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q " %### .#####" /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; " :. %% .#####" ;s="v=%04o;ev"%(;v=(v-($*+[45, " :####: :####" ])[n=0].to_i;)%360)+"al$s=%q#{ " %######. " ;;"%c"%126+$s<<126}";d.gsub!(/ " ##########. " |\s|".*"/,"");;require"zlib"|| " ########### " ;d=d.unpack"C*"d.map{|c|n=(n|| " :#########: " )*90+(c-2)%91};e=["%x"%n].pack " :#######% " &&"H*";e=Zlib::Inflate.inflate( " ######% " &&e).unpack("b*")[0];22.times{|y| " ####% " ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; " .###: " ;2))*23).floor;(w*2-1).times{|x|u=(e+ " %## " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " #. " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " . " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( " .##### :#" ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0341;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC "#% .#####%." 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B " : %#####%##. " O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? " #####%###: " g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W " %######## " lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. " :####### " R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 " :### : " 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ " %#... " EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q " .###: " /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; " :. %% " ;s="v=%04o;ev"%(;v=(v-($*+[45, " :####: " ])[n=0].to_i;)%360)+"al$s=%q#{ " %######. " ;;"%c"%126+$s<<126}";d.gsub!(/ " ##########" |\s|".*"/,"");;require"zlib"|| "% ##########" ;d=d.unpack"C*"d.map{|c|n=(n|| " :#########" )*90+(c-2)%91};e=["%x"%n].pack " ########" &&"H*";e=Zlib::Inflate.inflate( "#. ######%" &&e).unpack("b*")[0];22.times{|y| "## :####. " ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; "#. .###: " ;2))*23).floor;(w*2-1).times{|x|u=(e+ "% . %## " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " . #. " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " : " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( "#. .##### " ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0264;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC "####% .####" 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B "##### : .#####" O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? "######. #####%" g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W "####: . %######" lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. "#### . :######" R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 "####% ###: " 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ "### %#..." EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q "## .. %###" /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; ":#. . :" ;s="v=%04o;ev"%(;v=(v-($*+[45, ": : : " ])[n=0].to_i;)%360)+"al$s=%q#{ "% %#: " ;;"%c"%126+$s<<126}";d.gsub!(/ "#::#.: %#% " |\s|".*"/,"");;require"zlib"|| " : :#% " ;d=d.unpack"C*"d.map{|c|n=(n|| " :% : " )*90+(c-2)%91};e=["%x"%n].pack " %###%% " &&"H*";e=Zlib::Inflate.inflate( " ########. " &&e).unpack("b*")[0];22.times{|y| " ########. " ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; " ##:%###. " ;2))*23).floor;(w*2-1).times{|x|u=(e+ " %% . " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " . " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( "####. .###" ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0207;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC "#######% .#" 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B "##########: : " O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? "#############. " g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W "############: . " lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. "############# . " R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 "############## " 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ "# %######### " EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q " %#: %##: : " /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; " #. .:#. . " ;s="v=%04o;ev"%(;v=(v-($*+[45, " : : : : " ])[n=0].to_i;)%360)+"al$s=%q#{ " :% %#: " ;;"%c"%126+$s<<126}";d.gsub!(/ " #::#.: %#% " |\s|".*"/,"");;require"zlib"|| " : :#% " ;d=d.unpack"C*"d.map{|c|n=(n|| " :% : " )*90+(c-2)%91};e=["%x"%n].pack " .###%# " &&"H*";e=Zlib::Inflate.inflate( " ########. " &&e).unpack("b*")[0];22.times{|y| " :######## " ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; " ##:%###. " ;2))*23).floor;(w*2-1).times{|x|u=(e+ " %% . " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " . " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( "#######. ." ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0132;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC ":::#######%" 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B "################ : " O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? "####################. " g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W " .####:############: . " lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. "# # :################# . " R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 "#######################% " 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ "######:#### %######### " EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q "#######:##% .## .### .. " /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; "##########. #. .:#. . " ;s="v=%04o;ev"%(;v=(v-($*+[45, "#########% : : : : " ])[n=0].to_i;)%360)+"al$s=%q#{ "######### :% %#: " ;;"%c"%126+$s<<126}";d.gsub!(/ "#######% #::#.: %#% " |\s|".*"/,"");;require"zlib"|| ":######. : :#% " ;d=d.unpack"C*"d.map{|c|n=(n|| ".######: . :% : " )*90+(c-2)%91};e=["%x"%n].pack ":###### #: %###%% " &&"H*";e=Zlib::Inflate.inflate( ".####% :: ########. " &&e).unpack("b*")[0];22.times{|y| " %### ########. " ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; " .#% ##:%###. " ;2))*23).floor;(w*2-1).times{|x|u=(e+ " %% . " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " . " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( "##########." ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0055;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC "% :::#####" 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B " .:################" O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? " ######################" g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W " #. .####:############: " lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. " ##### # :################# . " R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 " :############################ " 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ " ############:#### %######### " EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q " %############:### %#: %##: : " /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; " .################. #. .:#. . " ;s="v=%04o;ev"%(;v=(v-($*+[45, " :##############% : : : : " ])[n=0].to_i;)%360)+"al$s=%q#{ " ######### :% %#: " ;;"%c"%126+$s<<126}";d.gsub!(/ " #######% #::#.: %#" |\s|".*"/,"");;require"zlib"|| " :######. : :" ;d=d.unpack"C*"d.map{|c|n=(n|| " .######: . :% " )*90+(c-2)%91};e=["%x"%n].pack " ######%:# .###%" &&"H*";e=Zlib::Inflate.inflate( " .####% :: ######" &&e).unpack("b*")[0];22.times{|y| " .###: :#####" ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; " .#% ##:%#" ;2))*23).floor;(w*2-1).times{|x|u=(e+ " " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( ":##########" ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
v=0000;eval$s=%q~d=%!^Lcf<LK8, _@7gj*LJ=c5nM)Tp1g0%Xv.,S[<>YoP4ZojjV)O>qIH1/n[|2yE[>:ieC "%.#% :::##" 97N-A&Kj_K_><wS5rtWk@*a+Y5yH?b[F^e7C/56j|pmRe+:)B "##% ::##########" O98(Zh)'Iof*nm.,$C5Nyt=PPu01Avw^<IiQ=5$'D-y? "##: ###############" g6`YT+qLw9k^ch|K'),tc6ygIL8xI#LNz3v}T=4W "# #. .####:#######" lL27FZ0ij)7TQCI)P7u}RT5-iJbbG5P-DHB<. " ##### # :############" R,YvZ_rnv6ky-G+4U'$*are@b4U351Q-ug5 " #######################" 00x8RR%`Om7VDp4M5PFixrPvl&<p[]1IJ " ############:#### %#####" EGgDt8Lm#;bc4zS^y]0`_PstfUxOC(q " .#############:##% .## ." /,}.YOIFj(k&q_VzcaAi?]^lCVYp!; " %% .################. #. " ;s="v=%04o;ev"%(;v=(v-($*+[45, ":####: :##############% : " ])[n=0].to_i;)%360)+"al$s=%q#{ "%######. ######### " ;;"%c"%126+$s<<126}";d.gsub!(/ "##########. #######% " |\s|".*"/,"");;require"zlib"|| "########### :######. " ;d=d.unpack"C*"d.map{|c|n=(n|| ":#########: .######: . " )*90+(c-2)%91};e=["%x"%n].pack " :#######% :###### #: " &&"H*";e=Zlib::Inflate.inflate( " ######% .####% :: " &&e).unpack("b*")[0];22.times{|y| " ####% %### " ;w=(Math.sqrt(1-((y*2.0-21)/22)**(; " .###: .#% " ;2))*23).floor;(w*2-1).times{|x|u=(e+ " %## " )[y*z=360,z]*2;u=u[90*x/w+v+90,90/w];s[( " #. " ;y*80)+120-w+x]=(""<<32<<".:%#")[4*u.count(( " . " ;"0"))/u.size]}};;puts\s+";_ The Qlobe#{" "*18+ ( "# :#######" ;"Copyright(C).Yusuke End\oh, 2010")}";exit~;_ The Qlobe Copyright(C).Yusuke Endoh, 2010
BEFOREHAND: close door, each window & exit; wait until time. open spellbook, study, read (scan, select, tell us);write it, print the hex while each watches, reverse its length, write again; kill spiders, pop them, chop, split, kill them. unlink arms, shift, wait & listen (listening, wait),sort the flock (then, warn the "goats" & kill the "sheep");
"eyes".scan /the_darkness/catch( :in_the_wind ) { ?a.round; "breath" \ or "a".slice /of_moon/ }
Source vs. Binary
Unity can only be manifested by the Binary. Unity itself and the idea of Unity are already two.- Buddha
Code vs. Data
The progression of the Lisp programmer: the newbie realizes that the difference between code and data is trivial. The expert realizes that all code is data. And the true master realizes that all data is code.- Unknown
Polyglot
The Tao gave birth to machine language. Machine language gave birth to the assembler. The assembler gave birth to the compiler. Now there are ten thousand languages.Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao. But do not program in COBOL if you can avoid it.- The Tao of Programming
The Temporal Dimension
The authenticity of a thing is the essence of all that is transmissible from its beginning, ranging from its substative duration to its testimony to the history which it has experienced. - Walter Benjamin, "The Work of Art in the Age of Mechanical Reproduction"
Integrating Copies
Even the most perfect reproduction of a work of art is lacking in one element: its presence in time and space, its unique existence at the place where it happens to be.- Walter Benjamin, "The Work of Art in the Age of Mechanical Reproduction"
Multiple Representations
Q: If only you and dead people understand hexidecimal, how many people understand hexidecimal?A: 57006.
Backporting
Software is like sex; make one mistake, and you'll be supporting it for the next 18 years.- Unknown
Levels of AbstractionWilliam James, father of American psychology, tells of meeting an old lady who told him the Earth rested on the back of a huge turtle. "But, my dear lady", Professor James asked, as politely as possible, "what holds up the turtle?" "Ah", she said, "that's easy. He is standing on the back of another turtle." "Oh, I see", said Professor James, still being polite. "But would you be so good as to tell me what holds up the second turtle?" "It's no use, Professor", said the old lady, realizing he was trying to lead her into a logical trap. "It's turtles-turtles-turtles, all the way!"- Prometheus Rising
an aside:
Software as a crisis of literacy
an aside to the aside:
terminology problems
Crisis - A point of great tension in a narrative that determines how the action will come out.