Upload
andy-marks
View
28
Download
1
Embed Size (px)
Citation preview
@andee_marks
The hills are alive... with the sound of your
crappy code
The hills are alive... with the sound of your
crappy code
@andee_marks
Background
https://www.youtube.com/watch?v=Sg2BjFQnr9shttps://www.youtube.com/watch?v=063FTX4FE3g
@andee_marks
Agenda
● Music theory redux● Aeolian ● Design choices (& examples)
@andee_marks
Music theory redux
@andee_marks
Tempo KeyNote OctaveChord
@andee_marks
github.com/andeemarks/aeolian
@andee_marks
Java source metrics ⇨ “music”
“the aeolian tonic chord is the submediant minor triad”
One note per line of code
Make good quality code pleasant to listen to
Make poor quality code unpleasant to listen to
@andee_marks
Tool chain
abc2midi timidityaeoliancheckstylebash
metrics
.abc
.midi
@andee_marks
Aeolian/Hello World
public class HelloWorld {public static void main(String args[]) {
System.out.println("Hello World!");}
}
X:1T:HelloWorld.metricsC:AEOLIANM:4/4L:1/8Q:1/4=140K:C%%MIDI gchord c| "C"E c b E, E, E, |
X:1T:HelloWorld.metricsC:AEOLIANM:4/4L:1/8Q:1/4=140K:C%%MIDI gchord c| "C"E c b E, E, E, |
@andee_marks
ABC Notation
X:1T:HelloWorld.metricsC:AEOLIANM:4/4L:1/8Q:1/4=140K:C%%MIDI gchord c| "C"E c b E, E, E, |
Tempo
Key
Octave
Note
Chord
@andee_marks
Design Choices
@andee_marks
Design Choices #1/Notes
<module name="LineLength">
(cond(< line-length 10)(note-from-octave octave-1 line-length)
(<= 10 line-length 39) (note-from-octave octave-2 line-length)
(<= 40 line-length 79) (note-from-octave octave-3 line-length)
...Notes
checkstyle
clojure
@andee_marks
Design Choices #2/Tempo
<module name="CyclomaticComplexity">
Tempo
checkstyle
(+ (* 20 complexity) default-tempo)
clojure
@andee_marks
Design Choices #3/Key
Keys
<module name="SimianCheck">
checkstyle
(if (< duplication-percentage 10)(set-major-key)(set-minor-key)))
clojure
@andee_marks
Design Choices #4/Accompanying chord
<module name="MethodLength">
checkstyle
(cond(<= 1 method-length 5)(chord 0)
(<= 6 line-length 10) (chord 1)
(<= 11 line-length 15) (chord 2)
...
clojure
Chord
@andee_marks
Design Choices #5/Instruments
(if (not (= current-author (get-author)))(instrument-for current-author)
clojure
Instruments
git blame...
bash
@andee_marks
Design Choices #6/Lyrics
(if (not (= current-source-file (get-source-file)))(lyrics-for current-source-file)
clojure
Lyrics
“Doe - a deerA female deerRay - a drop Of golden sunMe - a nameTo call myself”...
“Doe - a deerA female deerRay - a drop Of golden sunMe - a nameTo call myself”...
@andee_marks
Design Choices #7/Sequencing
Sequencing
git blame… sort…
bash
@andee_marks
Design Choices/Unresolved/Discarded
Comments
/**
**/
Volume Length
Note length Editor integration
Stereo
@andee_marks
Conclusion
@andee_marks
Line length ⇨ Note/octave
Cyclomatic complexity ⇨ Tempo
Method length ⇨ Accompanying chord
Duplication ⇨ Key
Git commit author ⇨ Instrument
Source file name ⇨ Karaoke lyric (for lolz)
@andee_marks
Conclusion
Thank You!Thank You!