4 ms·
Put another way, writing clean code is like writing prose. You need to clearly break down your thoughtt, whether its sections, paragraphs, sentences, and fragme
by epage 4y ago
Put another way, writing clean code is like writing prose. You need to clearly break down your thoughtt, whether its sections, paragraphs, sentences, and fragments, or files, functions, blocks, groups of lines.
Drove me nuts when working in a C# code base that controlled newlines because I had to break up related thoughts.
- devnullbrain 4y agoThe way you've described it is almost verbatim with how Google's C++ style guide puts it: https://google.github.io/styleguide/cppguide.html#Vertical_Whitespace https://google.github.io/styleguide/cppguide.html#Vertical_W...
- francislavoie 4y agoYeah. And when I write comments, I do it in explanation of the chunk of lines below which perform a particular idea. The newline after that chunk is necessary to break up the chunks to give room for another one below, etc.
- jay_kyburz 4y agoI really hate the c# code style of a new line for both open and close braces, especially in an if then else statement. Pushes people to use long ternary statements instead. I prefer ifs to ternarys because, more often than not, I want to easily add and remove statements to the body of the then or else as I'm working things out.