On Thu, Sep 11, 2014 at 10:12:43AM -0700, Gary Johnson wrote: > I think that's just a matter of taste and what your used to.
I don't. To some extent, yes... definitely. But some coding styles really do make code harder to read, and code that's harder to read is harder to understand. The GNU standard: - makes it harder to line up indented blocks visually, because the indent is too small to be easily distinguishable given many nested blocks (especially if they are not neatly balanced) - makes it harder to distinguish conditionals from function calls, both for the programmer, and for coding tools that try to care - empty parens separated from their function name by a space look like an operator (and indeed in some languages, they are) - wastes lines with nothing but a '{' The latter point may seem trivial, but if you're trying to READ a function written this way, it can result in as much as 50% of your logic being postponed to the next screen--depending on the contents of the function--making it harder for you to refer to earlier parts of the code without paging, losing sight of the part of the code you're trying to decipher. This is bad. Lastly, some editors / IDE's may rely on function calls being formatted without a space [e.g. foo() vs. foo ()] to properly colorize function calls. For instance, in VIM, this is the only way to colorize C function names in your program (there's a keyword to tell vim the names of functions, but it's really only useful for things that are standard, or at least common library code). You can tell vim to do this with something like: sy match cFunction "[A-Za-z0-9_]\+("me=e-1 But! If you configure this: - if(foo) will be colorized like a function call - foo (bar) will not be colorized, since foo is not a keyword, and it does not match the pattern If you don't configure it, only function names that vim knows about (mostly standard library / POSIX functions) will be colorized. Functions in your code won't be colorized, producing inconsistent colorization. -- Derek D. Martin http://www.pizzashack.org/ GPG Key ID: 0xDFBEAD02 -=-=-=-=- This message is posted from an invalid address. Replying to it will result in undeliverable mail due to spam prevention. Sorry for the inconvenience.
pgptcwaTFcjBM.pgp
Description: PGP signature