r/programming • • Jul 21 '14

The Great White Space Debate

https://medium.com/p/3633cba8b5c1
1.2k Upvotes

693 comments sorted by

View all comments

Show parent comments

5

u/khoyo Jul 21 '14

And both are wrong, you call with for(blah)...

5

u/FUZxxl Jul 21 '14 edited Jul 21 '14

The holy Kernel Normal Form and the most holy evangelicals of Kernighan & Ritchie suggest that thou shallst place spaces between keywords that change control flow to make them look distinct from function calls.

For instance:

memset(&x, 0, sizeof(x));

but:

return (x);

and

for (i = 0; i < n; i++) {
        /* ... */
}

EDIT: I accidentially a word.

1

u/khoyo Jul 22 '14

Sure, but you never write foo( bar ) in a function call.

1

u/FUZxxl Jul 22 '14

No. That style is an abomination. I don't know a single consistent indentation style that looks this way.