Mark-Jason Dominus, Plover Systems Co.
Track: Perl
Date: Tuesday, July 23
Time: 1:45pm - 5:15pm
Location: Grande Ballroom C
You've probably been working too hard when you program, writing twenty lines of code when you only needed ten. There is a better way, and this tutorial shows it to you. You'll learn how to improve your own code and the code of others, making it cleaner, more readable, more reusable, and more efficient, while at the same time making it 30-50% smaller. Smaller code contains fewer bugs and takes less time to maintain.
This class expands on 'Repair Shop I' but is independent of it, with little overlap. We'll see more red flags and more common errors. We’ll take a complete CGI tic-tac-toe application and reduce its code by half without removing any functionality or introducing any bugs. All code guaranteed authentic!
Participants are encouraged to submit their own code for anonymous review in the class. Class content varies depending on submissions, but is sure to include some of the following topics:
- Structural vs. functional code
- Elimination of structure
- Boolean values
- Programs that take two steps forward and one step back
- Programs that are 10% backslashes
- print print print print print
- C-style 'for' loops
- Loop counter variables
- Array length variables
- Unnecessary shell calls
- How (and why) to let 'undef' be the special value
- Confusion of internal and external representations of data
- Tool use
- Elimination of repeated code with higher-order functions
- Learning to use a hammer
- The 'swswsw' problem
- Avoiding special cases
- Using uniform data representations