Style discussions are driving me mad. OK, it may be because I had too much decaf coffee lately.
Still, let me elaborate. The raison d'etre of style guides is that they save time:
- You don't have to think about how you lay out the code. You focus on the problem.
- You can read code written by your team-mates because the layout looks familiar. You focus on understanding semantics.
These things work because you form instincs and the issue of arranging stuff on the screen disappears. Bang! You suddenly have more brain real-estate to devote to higher-level considerations like syntax and even semantics. Except, it doesn't work. Instead, this is what happens:
- When writing code you find yourself thinking Is this style acceptable to my team-mates? And that interrupts the flow of thought.
- Style junkies harass me for the strangest reasons.
- Whenever someone asks a style related question a flood of emails appears, which evidently are a symptom of a huge time-waste. (People need to take time to write those emails, form sentences, split into paragraphs, think about how to lay out the words... You know, the usual stuff.)
Could someone please write that SCM tool that understands syntax trees and shows each programmer the code in whatever way he wants? Please!