Java Reference
In-Depth Information
I am in Colorado, looking at a quarter-mile-long, class V+ rapid called Pine
Creek. I prefer the steeper, tighter runs of the East to these powerful western rap-
ids, but here I am. Neither my friends nor I have run anything so dangerous,
technical, and demanding. We all decide to portage the first and most difficult
part of the rapid and maybe the rest as well. The crucial move is an S-turn
around some massive turbulence called the Pine Creek Hole. The Hole regularly
traps kayaks and even larger craft with dire consequences for some. The 30-foot
hydraulic can be fatal. We ultimately decide to put in just below the Hole.
After staring at the hydraulic from 50 feet up, we decide that the rest of the
rapid's features look relatively placid. As we shoulder the boats down to river level,
we find that the mind-numbing size of Pine Creek Hole has biased our perception
of the rest of the rapid. Before our eyes, the Class IV rapid that we expect slowly
morphs into an expert-level Class V-. The 5-foot wave trains we expected are twice
as high. The numerous little 3-foot drops have grown to 8 feet.
Feeling confident in my ability and the ample space to avoid dangerous obsta-
cles, I get into my boat and start my run. As I approach the fourth massive wave
in the initial train, I flip. I've never had to execute a roll in such violent condi-
tions before, but with the power and speed of the river this time, swimming could
be disastrous. Submerged under a large wave I hold my breath for what seems to
be forever, waiting for my chance to roll.
Why study programming hygiene?
Why should we even consider something as banal as coding standards in Bitter
Java ? Shouldn't we leave this tedious subject to be covered in coding guide-
lines buried on a server or team leader's desk? In the past, I'd have been the
last person to write a chapter about coding style guidelines, but my recent
programming experiences have convinced me of their value. In many cases,
bad Java can be traced directly to bad form. Good programming hygiene
keeps intentions clear, makes it easier to share a code base, and enables effi-
cient refactoring.
In this chapter, we'll review some of the coding conventions we've dis-
cussed so far in Bitter Java . We'll also examine common hygiene-related mis-
steps, and we'll provide a helpful set of conventions. Finally, we'll present a
real-world style guide and a summary of coding standards.
Extreme programming requires good hygiene
My experience at allmystuff with extreme programming ( XP ) convinced me of
the value of good coding standards. XP has a small number of rules that make
Search WWH ::

Custom Search