SlideShare a Scribd company logo
@andee_marks
Does
Andy Marks
Technical Principal
ThoughtWorks
Smelly
Code
Sound
Also
Bad?
@andee_marks
Background
@andee_marks
Agenda
Music Theory Redux
Aeolian
Design Choices (& examples)
@andee_marks
A Music Theory Primer
Notes Tempo KeysOctave
@andee_marks
github.com/andeemarks/aeolian
“the aeolian tonic chord is the submediant minor triad”
Java
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
metrics
.abc
.midi
abc2midi
@andee_marks
Aeolian/Hello World
public class HelloWorld {
public static void main(String args[]) {
System.out.println("Hello World!");
}
}
X:1
T:HelloWorld.metrics
C:AEOLIAN
M:4/4
L:1/8
Q:1/4=140
K:C
%%MIDI gchord c
| "C"E c b E, E, E, |
X:1
T:HelloWorld.metrics
C:AEOLIAN
M:4/4
L:1/8
Q:1/4=140
K:C
%%MIDI gchord c
| "C"E c b E, E, E, |
⇨
@andee_marks
ABC Notation
X:1
T:HelloWorld.metrics
C:AEOLIAN
M:4/4
L:1/8
Q:1/4=140
K:C
%%MIDI gchord c
| "C"E c b E, E, E, |
Notes
Tempo
Keys
⇨
Octave
@andee_marks
Design Choices
@andee_marks
Design Choices #1/Notes
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)
...
⇨
@andee_marks
Design Choices #2/Tempo
Tempo
(+ (* 20 complexity) default-tempo)
<module name="CyclomaticComplexity">
⇨
@andee_marks
Design Choices #3/Key
Keys
⇨
<module name="SimianCheck">
(if (< duplication-percentage 10)
(set-major-key)
(set-minor-key)))
@andee_marks
Design Choices #4/Instruments
Instruments
⇨
(if (not (= current-author (get-author)))
(instrument-for current-author)
@andee_marks
Design Choices #5/Lyrics
Lyrics
(if (not (= current-source-file (get-source-file)))
(lyrics-for current-source-file)
@andee_marks
Design Choices #6/Sequencing
Sequencing
@andee_marks
Design Choices/Unresolved
Volume
⇨
Stereo Length
Note length Comments
/**
**/ Editor
integration
@andee_marks
Conclusion
@andee_marks
Visual indicators
@andee_marks
if (is_smelly?(code)) {
set_build_light(“red”);
} else {
set_build_light(“green”);
}
if (is_smelly?(code)) {
play “What Does The Fox Say (Ylvis)”;
} else {
play “The Blue Danube (Strauss)”;
}
Audio indicators

More Related Content

Similar to 2017 YOW West: "Does Smelly Code Also Sound Bad?"

Space Codesign at TandemLaunch 20150414
Space Codesign at TandemLaunch 20150414Space Codesign at TandemLaunch 20150414
Space Codesign at TandemLaunch 20150414
Space Codesign
 
Space Codesign at TandemLaunch Lunch & Learn 20150414
Space Codesign at TandemLaunch Lunch & Learn 20150414Space Codesign at TandemLaunch Lunch & Learn 20150414
Space Codesign at TandemLaunch Lunch & Learn 20150414
Gary Dare
 
EDM for Europeana Sounds
EDM for Europeana SoundsEDM for Europeana Sounds
EDM for Europeana Sounds
Europeana_Sounds
 
Huffman
HuffmanHuffman
Cpcs302 1
Cpcs302  1Cpcs302  1
Cpcs302 1
guest5de1a5
 
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Maarten Balliauw
 
EDM for sounds
EDM for soundsEDM for sounds
EDM for sounds
Cecile Devarenne
 
Project nivel mayor
Project   nivel mayorProject   nivel mayor
Project nivel mayor
Adrian Esparza
 
Arduino at Indie memphis 2013
Arduino at Indie memphis 2013Arduino at Indie memphis 2013
Arduino at Indie memphis 2013
michaelshiloh
 
Code Review
Code ReviewCode Review
Code Review
rantav
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
Emre Dündar
 
01. introduction
01. introduction01. introduction
01. introduction
babaaasingh123
 
Deep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problemDeep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problem
Sirawat Pitaksarit
 
Wiki dev nlp
Wiki dev nlpWiki dev nlp
Wiki dev nlp
ICSM 2010
 
fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...
fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...
fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...
fOSSa - Free Open Source Software Academia Conference
 
Erlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The UglyErlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The Ugly
enriquepazperez
 
Ti1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming LinguisticsTi1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming Linguistics
Eelco Visser
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
Eelco Visser
 

Similar to 2017 YOW West: "Does Smelly Code Also Sound Bad?" (18)

Space Codesign at TandemLaunch 20150414
Space Codesign at TandemLaunch 20150414Space Codesign at TandemLaunch 20150414
Space Codesign at TandemLaunch 20150414
 
Space Codesign at TandemLaunch Lunch & Learn 20150414
Space Codesign at TandemLaunch Lunch & Learn 20150414Space Codesign at TandemLaunch Lunch & Learn 20150414
Space Codesign at TandemLaunch Lunch & Learn 20150414
 
EDM for Europeana Sounds
EDM for Europeana SoundsEDM for Europeana Sounds
EDM for Europeana Sounds
 
Huffman
HuffmanHuffman
Huffman
 
Cpcs302 1
Cpcs302  1Cpcs302  1
Cpcs302 1
 
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
Nerd sniping myself into a rabbit hole... Streaming online audio to a Sonos s...
 
EDM for sounds
EDM for soundsEDM for sounds
EDM for sounds
 
Project nivel mayor
Project   nivel mayorProject   nivel mayor
Project nivel mayor
 
Arduino at Indie memphis 2013
Arduino at Indie memphis 2013Arduino at Indie memphis 2013
Arduino at Indie memphis 2013
 
Code Review
Code ReviewCode Review
Code Review
 
Continuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQubeContinuous Inspection of Code Quality: SonarQube
Continuous Inspection of Code Quality: SonarQube
 
01. introduction
01. introduction01. introduction
01. introduction
 
Deep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problemDeep dive into Android’s audio latency problem
Deep dive into Android’s audio latency problem
 
Wiki dev nlp
Wiki dev nlpWiki dev nlp
Wiki dev nlp
 
fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...
fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...
fOSSa2012- shruti - mutable instrument - open hardware diy 80s sonic aestheti...
 
Erlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The UglyErlang Developments: The Good, The Bad and The Ugly
Erlang Developments: The Good, The Bad and The Ugly
 
Ti1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming LinguisticsTi1220 Lecture 1: Programming Linguistics
Ti1220 Lecture 1: Programming Linguistics
 
CS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: IntroductionCS4200 2019 Lecture 1: Introduction
CS4200 2019 Lecture 1: Introduction
 

More from Andy Marks

YOW! Perth 2022 - Reviving the Art of Software Design
YOW! Perth 2022 - Reviving the Art of Software DesignYOW! Perth 2022 - Reviving the Art of Software Design
YOW! Perth 2022 - Reviving the Art of Software Design
Andy Marks
 
Top 5 Software Purchasing Fails for an Agile Environment
Top 5 Software Purchasing Fails for an Agile EnvironmentTop 5 Software Purchasing Fails for an Agile Environment
Top 5 Software Purchasing Fails for an Agile Environment
Andy Marks
 
"Kata" your way to better architecture skills
"Kata" your way to better architecture skills"Kata" your way to better architecture skills
"Kata" your way to better architecture skills
Andy Marks
 
"Kata" your way to better architecture skills
"Kata" your way to better architecture skills"Kata" your way to better architecture skills
"Kata" your way to better architecture skills
Andy Marks
 
IT Sociopath Bingo
IT Sociopath BingoIT Sociopath Bingo
IT Sociopath Bingo
Andy Marks
 
Developer Experience (DX) as a Fitness Function for Platform Teams
Developer Experience (DX) as a Fitness Function for Platform TeamsDeveloper Experience (DX) as a Fitness Function for Platform Teams
Developer Experience (DX) as a Fitness Function for Platform Teams
Andy Marks
 
Melbourne Clojure Meetup Jan 2018 - ClojureBridge
Melbourne Clojure Meetup Jan 2018  - ClojureBridgeMelbourne Clojure Meetup Jan 2018  - ClojureBridge
Melbourne Clojure Meetup Jan 2018 - ClojureBridge
Andy Marks
 
YOW WEST 2014: "Adopting Functional Programming Languages"
YOW WEST 2014: "Adopting Functional Programming Languages"YOW WEST 2014: "Adopting Functional Programming Languages"
YOW WEST 2014: "Adopting Functional Programming Languages"
Andy Marks
 
YOW West 2015: "Macromonitoring for Microservices"
YOW West 2015: "Macromonitoring for Microservices"YOW West 2015: "Macromonitoring for Microservices"
YOW West 2015: "Macromonitoring for Microservices"
Andy Marks
 
Lambda Jam 2015: Event Processing in Clojure
Lambda Jam 2015: Event Processing in ClojureLambda Jam 2015: Event Processing in Clojure
Lambda Jam 2015: Event Processing in Clojure
Andy Marks
 
ThoughtWorks Live 2014: "Building Systems That Pivot"
ThoughtWorks Live 2014: "Building Systems That Pivot"ThoughtWorks Live 2014: "Building Systems That Pivot"
ThoughtWorks Live 2014: "Building Systems That Pivot"
Andy Marks
 
YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"
YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"
YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"
Andy Marks
 
1st conference 2015 devops
1st conference 2015   devops1st conference 2015   devops
1st conference 2015 devops
Andy Marks
 
Quality versus-speed-tradeoffs
Quality versus-speed-tradeoffsQuality versus-speed-tradeoffs
Quality versus-speed-tradeoffs
Andy Marks
 
Agile Methods for NTU Software Engineers
Agile Methods for NTU Software EngineersAgile Methods for NTU Software Engineers
Agile Methods for NTU Software Engineers
Andy Marks
 
Aws map-reduce-aws
Aws map-reduce-awsAws map-reduce-aws
Aws map-reduce-aws
Andy Marks
 

More from Andy Marks (16)

YOW! Perth 2022 - Reviving the Art of Software Design
YOW! Perth 2022 - Reviving the Art of Software DesignYOW! Perth 2022 - Reviving the Art of Software Design
YOW! Perth 2022 - Reviving the Art of Software Design
 
Top 5 Software Purchasing Fails for an Agile Environment
Top 5 Software Purchasing Fails for an Agile EnvironmentTop 5 Software Purchasing Fails for an Agile Environment
Top 5 Software Purchasing Fails for an Agile Environment
 
"Kata" your way to better architecture skills
"Kata" your way to better architecture skills"Kata" your way to better architecture skills
"Kata" your way to better architecture skills
 
"Kata" your way to better architecture skills
"Kata" your way to better architecture skills"Kata" your way to better architecture skills
"Kata" your way to better architecture skills
 
IT Sociopath Bingo
IT Sociopath BingoIT Sociopath Bingo
IT Sociopath Bingo
 
Developer Experience (DX) as a Fitness Function for Platform Teams
Developer Experience (DX) as a Fitness Function for Platform TeamsDeveloper Experience (DX) as a Fitness Function for Platform Teams
Developer Experience (DX) as a Fitness Function for Platform Teams
 
Melbourne Clojure Meetup Jan 2018 - ClojureBridge
Melbourne Clojure Meetup Jan 2018  - ClojureBridgeMelbourne Clojure Meetup Jan 2018  - ClojureBridge
Melbourne Clojure Meetup Jan 2018 - ClojureBridge
 
YOW WEST 2014: "Adopting Functional Programming Languages"
YOW WEST 2014: "Adopting Functional Programming Languages"YOW WEST 2014: "Adopting Functional Programming Languages"
YOW WEST 2014: "Adopting Functional Programming Languages"
 
YOW West 2015: "Macromonitoring for Microservices"
YOW West 2015: "Macromonitoring for Microservices"YOW West 2015: "Macromonitoring for Microservices"
YOW West 2015: "Macromonitoring for Microservices"
 
Lambda Jam 2015: Event Processing in Clojure
Lambda Jam 2015: Event Processing in ClojureLambda Jam 2015: Event Processing in Clojure
Lambda Jam 2015: Event Processing in Clojure
 
ThoughtWorks Live 2014: "Building Systems That Pivot"
ThoughtWorks Live 2014: "Building Systems That Pivot"ThoughtWorks Live 2014: "Building Systems That Pivot"
ThoughtWorks Live 2014: "Building Systems That Pivot"
 
YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"
YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"
YOW West 2016: "A Rose By Any Other Name: Monoglot Microservices"
 
1st conference 2015 devops
1st conference 2015   devops1st conference 2015   devops
1st conference 2015 devops
 
Quality versus-speed-tradeoffs
Quality versus-speed-tradeoffsQuality versus-speed-tradeoffs
Quality versus-speed-tradeoffs
 
Agile Methods for NTU Software Engineers
Agile Methods for NTU Software EngineersAgile Methods for NTU Software Engineers
Agile Methods for NTU Software Engineers
 
Aws map-reduce-aws
Aws map-reduce-awsAws map-reduce-aws
Aws map-reduce-aws
 

Recently uploaded

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
Techgropse Pvt.Ltd.
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
Zilliz
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
Claudio Di Ciccio
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
SitimaJohn
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
Mariano Tinti
 

Recently uploaded (20)

Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdfAI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
AI-Powered Food Delivery Transforming App Development in Saudi Arabia.pdf
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Infrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI modelsInfrastructure Challenges in Scaling RAG with Custom AI models
Infrastructure Challenges in Scaling RAG with Custom AI models
 
CAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on BlockchainCAKE: Sharing Slices of Confidential Data on Blockchain
CAKE: Sharing Slices of Confidential Data on Blockchain
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxOcean lotus Threat actors project by John Sitima 2024 (1).pptx
Ocean lotus Threat actors project by John Sitima 2024 (1).pptx
 
Mariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceXMariano G Tinti - Decoding SpaceX
Mariano G Tinti - Decoding SpaceX
 

2017 YOW West: "Does Smelly Code Also Sound Bad?"

Editor's Notes

  1. Can I just start by saying “isn’t it good that we’re tackling the BIG issues here at YOW?” From Mars Exploration to the Meaning of Life to the ultimate question of our time really: Does Smelly Code Also Sound Bad? Still, I guess it beats more conversations around microservices… so 2015 right!?! So I work at ThoughtWorks and this talk is about two concepts which are near and dear to my heart, but it’s also a demonstration of some software that I inflicted upon this world from a hack day back in 2015, which we’ll get to.
  2. So what brings me here today? Well I have a more than a passing interest in both code quality and music quality. I’ve worked as a professional programmer for the best part of my career, producing lots of code of various degrees of quality, depending on my capabilities and external circumstances but I’m also a very strictly non-professional musician who produces music of various degrees of quality… again, depending on my capabilities an external circumstances such as how much I’ve had to drink before playing and whether the guitarists keeps standing on my instrument lead. [TX] I play bass with a bunch of colleages from ThoughtWorks in a band, so in the grand tradition of bass playing, here’s a picture of me being obscured by the more important members of our band. But it was a couple of moments like this which inevitably push me towards writing the software I’ll be talking about today - moments of sitting on conference audiences watching speakers talk about geek-y stuff that really interests them. [TX] Moment 1 was seeing Sau Sheng Cheong, who ran the R&D group for Hewlett Packard in Singapore talk at the RedDotRuby Conf in Singapore in 2012. Sau Sheng had written a nice little Ruby DSL for producing WAV files from Ruby which, because it produced lots of squawks and chirps during the presentation was a really interesting deviation from the other talks at the conf. [TX] Moment 2 leading to today and still the most enjoyable conference talk I’ve ever seen is stumbling onto this man - Andrew Sorensen - presenting at YOW 2013. It was one of those moments of the schedule where there was no clear winner as to which talk I most wanted to go to and the talk blurbs didn’t really reveal too much so I mentally flipped a coin and when to see Andrew. His talk “Programming in Time” was about the live coding community, a movement where programming musicians - or musical programmers - will write code to produce music in a live setting. Much of his talk was a live demo of him producing music using Extemporare, a lisp-based DSL of his own devising. And to me, it was astonishing to watch someone hack away at what looked like Clojure in Emacs and have beautiful atmospheric music come out the other end. More than anything, it was that experience which has resulted in me standing here today, TW Hack day
  3. [TX] Ultimately what I’m going to demonstrate is a method for mapping code quality to sound… dare I say music, although possibly not music as you know it. [TX] Along the way we’ll talk a bit about music theory (but not too much - after all, I’m a bass player so by definition I’m not going to have too much to say on this matter), various code metrics and how to make music sound bad… which is possibly a cue for another bass player joke as well come to think of it. [TX] And there’ll be lots of audio examples of good and bad code as well.
  4. Which brings us to my little primer on music theory - and I’ve really limited this to what you need to know to understand how Aeolian works. [TX] Firstly, we have the concept of music notes, which - if you remember back to your first introduction to music theory at school, consist of pitch and duration light a quarter note C, or an eighth note A sharp. [TX] Next we have the meter of the song which dictates how many notes you’ll hear in each measure and [TX] Next we have the tempo of the song, telling us how many of the fundamental notes will be played each minute [TX] And finally the key of the song, which gives some guidance to note selection and suggests the overall mood of the song, specifically with major keys sounding upbeat and happy whilst minor keys sound more menacing and sombre. There’s a whole lot more to music theory than just these concepts, but this should be enough to get you through to the end of this presentation.
  5. So let’s take Aeolian for a spin around the block and see what it can do. That’s where you can find it should you want to play by yourself at home. There are a small number of dependencies which are listed in the Readme. One big limitation is that it’s only capable of evaluating Java source code at the moment: Why Java? I hear you ask. Well, the snarky person in me says that that’s where all the smelly code in the world lives, but the truth is far more mundane than that… Java is a static language which makes lexical analysis for code quality easier than some of my preferred languages and I know Checkstyle quite well, which is what I use to derive my sense of code quality. And what’s in the name “aeolian”? Well, it’s a term from a more advanced level of music theory than I covered before but a common definition is “the aeolian tonic chord is the submediant minor triad”. TO be honest, I’m not sure if that’s a common definition or not, but it sounds so much like a functional programmer saying that a monad is “a monoid in the category of endofunctors” that I couldn’t resist… and hello to all my Haskell friends out there :-)
  6. And here’s how it all hangs together [TX] We start with a bunch of script-y magic clone-ing a specified repo and running Checkstyle over it [TX] Checkstyle is running a bunch of specific metric checks and producing a load of customised file output [TX] The same Bash scripts pass the generated Checkstyle output files into a Clojure program which does most of the hard lifting of producing the music, using a textual, reasonably readable format called ABC Notation. [TX] A program called abc2midi does exactly what the name suggest - MIDI standing for Musical Instrument Device Interface, a very common standard for the exchange of electronic music information [TX] And timidity in this case plays the resultant MIDI file
  7. So what does our old friend Hello World sound like via Aeolian? [DEMO] I know, I know - it’s overwhelming isn’t it? I get that reaction a lot :-) Unfortunately, Hello World is nowhere near smelly enough or long enough to produce something worthy of our ears, although I will show you the ABC Notation it generated.[TX] [TX] It’s really only the last line that plays the music and for those who are interested, that a directive to play a A minor chord and underneath that play an E, then a C, then a B (all as quarter notes), then a quarter note rest.
  8. L: Default note length (if unspecified) [TX] [TX] [TX] [TX]
  9. And because this demo is about rendering an abstract representation of an aspect of our code, we should quickly talk about the way most of us do this now, which has been via our good friend, the Delcom build light or it’s close cousins. We’ve probably all used or seen these in use, green means the CI build is good, red means the CI build is bad, flashing might mean it’s building or some nether state like that… the point is that these ubiquotous lights show us a very binary moment in time representation of what they are measuring. All of which is perfectly good, but it’s interesting to compare the matter-of-fact nature of a red/green build light versus the more fine grained opportunities a musical score can give you.
  10. When you think about the logic behind a build light, it’s really incredibly basic and something like this [TX]. Normally the notion of “smelly” also involves the tests passing as well as code quality, but it’s really not much more complex than this… which means if we wanted to, we could certainly take the same approach to turning code quality into music [TX], but that’s kind of cheating. Although I have to admit this sort of approach would lead to some great heated conversations within delivery teams as to what song should represent green versus red :-) No, nothing so simple for us in creating an audio version of our code quality - we’re programmers and we never take a simple solution when an overly complex one will do, do we?!? Because with complete control over the generation of our notes, we can create something which is not so much a song as it is a soundtrack for our code quality. And soundtracks differ from the Westernised version of songs in that they tend to be far more linear and progressive nature and lean heavily on the music to set the tone and tell the story rather than the lyrics and repeated elements like choruses.