©2010 Improving Enterprises, Inc. 
Good Code 
What, Why, and How to Get There 
Dallas TechFest 2014 
Jane Prusakova 
Josh Rizzo 
@Improving Enterprises College Station
©2010 Improving Enterprises, Inc. 
What is “good”? 
Functional 
Bug-free 
Performant 
Good design 
Tested 
Testable 
Easy to change
©2010 Improving Enterprises, Inc. 
Usability 
Users and clients Developers
©2010 Improving Enterprises, Inc.
“Programs must be written for 
people to read, and only 
incidentally for machines to 
execute.” 
– Abelson and Sussman 
©2010 Improving Enterprises, Inc.
©2010 Improving Enterprises, Inc. 
Readability has value 
NOW 
Code is an asset 
affects productivity 
monetary value
Readability has value 
OVER TIME 
Software evolves over time 
Work by many different teams 
Changes affect value
©2010 Improving Enterprises, Inc. 
Readability has cost 
More hard work 
More time 
More training
©2010 Improving Enterprises, Inc. 
Readable code
©2010 Improving Enterprises, Inc. 
Who is responsible? 
It was hard to write 
It should be hard to 
read
Lets make code more… 
See: https://github.com/joshrizzo/Readability 
©2010 Improving Enterprises, Inc.
©2010 Improving Enterprises, Inc. 
Visible code 
Short and concise 
Spacing and indent matter 
“If we wish to count lines of code, we should 
not regard them as ‘lines produced’ but as 
‘lines spent.’” 
– Edsger Dijkstra
©2010 Improving Enterprises, Inc. 
Code with a narrative 
Use naming to show intent 
Interface design 
“Programming can be fun, so can 
cryptography; however they should not be 
combined.” 
– Kreitzberg and Shneiderman
©2010 Improving Enterprises, Inc. 
Easy to read 
Cohesive level of abstraction 
“The purpose of abstraction is not to be 
vague, but to create a new semantic level in 
which one can be absolutely precise.” 
– Edsger Dijkstra
©2010 Improving Enterprises, Inc. 
Readable++ 
Simplicity
“Everything should be made 
as simple as possible, but not 
simpler.” 
©2010 Improving Enterprises, Inc. 
– Albert Einstein
©2010 Improving Enterprises, Inc. 
Simple vs Fast 
Correctness more important than speed 
Simple code is more likely to be and stay 
correct 
Modularize code w/ performance concerns 
Optimize locally
©2010 Improving Enterprises, Inc.
©2010 Improving Enterprises, Inc. 
Simple vs Flexible 
Re-use is rare 
Predictions of re-use are poor 
Raises complexity significantly 
Unused => not working
©2010 Improving Enterprises, Inc. 
Simple vs Clever 
Over engineering 
Mixing abstractions 
Inappropriate patterns 
Complicated syntax
©2010 Improving Enterprises, Inc. 
Good Code 
What, Why, and How to Get There 
https://github.com/joshrizzo/Readability 
Dallas TechFest 2014 
Jane Prusakova 
Josh Rizzo 
@Improving Enterprises College Station

Lets talk About Good Code (Dallas TechFest 2014)

Editor's Notes

  • #3 Usability: The system needs to be functional for the users and clients. Usability: The code needs to be readable for the current and future development of the system.
  • #5 My most popular slide from the #live360 keynote: a comical explanation of how software dev keeps getting harder.
  • #6 Abelson founding director of both Creative Commons and the Free Software Foundation. Sussman and Abelson are co-authors of popular textbook “Structure and Interpretation of Computer Programs”
  • #13 Edsger Dijkstra was a Dutch computer scientist, known for introducing the idea that GOTO is a smell, developing shortest path algorithm, and developing the concept of formal verification.
  • #14 Ben Shneiderman studied programmers and their interactions with the code, developed principles of interface design, worked on information visualization and usability.
  • #16 This quote first appear in Reader’s Digest in 1977, with no supporting references. Attributed to Einstein from someone’s memory, not found in his writings.
  • #17 This quote first appear in Reader’s Digest in 1977, with no supporting references. Attributed to Einstein from someone’s memory, not found in his writings.
  • #19 Bucatti Veyron, top speed 267mph, total production 450 unit. Toyota Corolla, top-selling car for many years. Doesn’t go faster than 111mph. Sold 1.2 units world-wide.