Coding Style

Jim's Pages => Java Pages => Jim's Coding Style

In the corporate team setting, I'm big on getting everyone to code in one style. At work I bought every programmer the Elements of Java Style (sure beats wasting time making up your own standards document!) and wrote up a small set of exceptions and extensions. When I code at work I follow the team standards.

In my home code, I use my own mix of styles.

m for method
l for local
a for argument

Examples:

mEvent   = aEvent;               
lHashKey = mHashKey.toUpper();

I find I spend a lot more time reading code than most programmers. I examine code from my own pen, the rest of the team, magazines, books and websites. I see way too much code that was written and never read, meaning the coder didn't even look back to see if it made sense or looked nice afterwards. Almost any consistent style helps readability. I've given up trying to convince anyone else to copy my little quirks, but I hope that when applied consistently they'll contribute to readability.