I might be one anal programmer, but I like code that looks good from a distance. I just found myself lining up a CSS style so that instead of this:
#divPreview {
text-align: center;
vertical-align: middle;
border: #779 1px solid;
overflow: auto;
width: 210px;
height: 128px;
background-color: #fff"
}
it now looks like:
#divPreview {
width: 210px;
height: 128px;
overflow: auto;
text-align: center;
vertical-align: middle;
border: #779 1px solid;
background-color: #fff";
}
I will almost always write numerical comparisons in order of size like
if (0 < n && n < 10)
instead of
if (0 < n && 10 > n)
and finally I will tend to arrange if-then-else code so that the THEN part is smaller than the ELSE part (cause the heavier stuff goes to the bottom, right?)
if (afflicted == true) {
GetSome();
HelpRight();
}
else {
NowPlease();
}
ugh!
if (afflicted == false) {
HowMuchTrouble();
}
else {
IsItToDo();
ThisReally();
}
aahhh
I could go on and on with more examples, but you get the idea...
Question: Am I alone in my neurosis here? What's your coding kink?