When I write code, I try to group lines of similar code together, then leave a blank line and write another block.
I believe this contributes to the neatness and readability of the code.
I'm not a big fan of bunching stuff together without any line spacing. It looks like hell, it's hard to read and it's difficult to follow.
One of the teachers I had, downgraded one of my assignments because I had spaced my code logically. He said, 'When you have to read code all day in the real world, you won't put this line spacing in and you'll be thanking me." Of course, I never did and never will thank him.
Now that I'm in the real world, most of the code files I see that have absolutely no line spacing are poorly written and poorly thought out.
This is probably more prevelant in VB type languages than in C type languages, but the same concept applies.
Two questions come to mind:
- Where do you leave a blank line in your code?
- How much line spacing is too much?