DeXecipher wrote: |
---|
some people code like this, and it bugs the sh!t out of me when I want to read it. Especially on this website. |
It's worth noting that people may actually have used indentation using tabs, but the tabs were not transferred in copy-pasting, because HTML-textarea's don't accept tabs. Most proper text editors will let you configure tabs as spaces, but that's a whole other religious war I won't embark on.
@Fredbill30 There are quite a few indentation styles around: http://en.wikipedia.org/wiki/Indent_style
Preference of one over another is a matter of personal taste and so there is no "one true answer".
People generally associate their personal tastes with their sense of identity, so criticizing their preference might lead to strong reactions in some people (aka flame wars).
That being said, the defence that seems to come up most often in favour of style such as K&R is to avoid using "extra lines". I personally feel that putting curly braces on their own line, whilst indenting their "content", makes it visually very clear that this is a code-block. I've read that the extra lines argument comes from the time where people could only fit so many lines on a screen or buffer, which doesn't hold up any longer.
The "best" style is the one that is used persistently in a project by all its members, that's about as far as I'd go to generalize.
All the best,
NwN