3
muma
6y

K&R style Brackets are so goddamn shitty. I hate hate hate hate that style. It makes code so goddamn hard to read. And for what gain? You write "less" lines of code? So what? Who gives five fucks about that? Readability is key for coders.

Comments
  • 0
    Which one is that?
  • 2
    @Cyanide

    while (x == y) {

    something();

    somethingelse();

    }

    BTW: Devrant needs code blocks.
  • 1
    @muma Oh this .. I love this :)
  • 0
    @gintko realistically how many lines of code can one really see? Also: Vertical mode is a thing for screens nowadays. And all that nice amount of code is totally useless if you have to remember yourself which bracket is used where.
  • 0
    @gintko compare the K&R style with the Whitesmiths style: Using the Whitesmiths style i can look at the code and see the structure at a glance, independently of the tool i use. It is clearly obvious just from looking at it. Personally i think it is also more visually pleasing, but that is up to taste.

    Python is a completely different topic. I really like that python has minimized the usage of brackets, especially for the if, for, while and def keywords. It is the most pleasing of all, and intendation works perfectly there
  • 0
    @RantSomeWhere for functions K&R have the opening bracket on the next line, for everything else on the same line. Their reasoning is that functions are special because they can't be nested (at least in c).
  • 0
    No, K&R sucks because it lets you omit braces from if blocks with single statements. Coming from Rust, where OTB is common (and braces are required by the language syntax for control flow statements), it is definitely a superior variant of K&R.

    Oh, and function definitions that can ergonomically span multiple lines because of the return type being after the parameters:

    fn name<T>(params)
    -> returns
    where
    T: FromStr,
    { ... }
Add Comment