View Single Post
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 01-16-2010 , 12:27   Re: [TUT] Code Styling & Good Programming Habits
Reply With Quote #7

Quote:
Originally Posted by SnoW View Post
Your reasoning is just unbelievable. If you wanted to have all the code in one line you could, but that's not you want. You want the code to look decent, readable and not ugly and that's why you line break. As simple as that.
You didn't understand what I mean, I don't want 1-line code.

Quote:
Originally Posted by Bugsy View Post
Readability is far more important than line count. If you are worried about fitting more code on one page, reduce your font size . Furthermore, code looks ugly when there's not a new-line before an opening bracket. Yes, I can look at any code and still know what is going on but it is a hell of a lot easier to read with proper line-breaks, spacing, and indentation.
Having the opening bracket in the same line of the "code block starter" statement doesn't interfer with readability. Think of you reading some code, when you see an "if" or a "do" or a "while" or anything that imply a code block, you already know that there's a code block coming, and indentation makes that more explicit. But, in the other hand, you can't predict when the code block will end, that's the reason to put the closing bracket alone in one line. More code fitting in the page is for consistency, is way better to have functions that fit in one page, so you don't need to scroll up and down following the execution path.
Seta00 is offline