Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's the reason why table layout in code is considered bad?
    text
    copied!<p>My colleagues tell me that table based formatting of code is bad and it is no readable and I should follow conventions. What's that bad about table based formatting? Why is it banned?</p> <p>I'm asking because for me it's much more readable.</p> <p>Examples (not real code):</p> <pre><code>if (res == ResultType.Failure) something = ProcessFailure(..); if (res == ResultType.ScheduledAndMonitored) something = DoSomething(...) &amp;&amp; DoSomething3(..); if (res == ResultType.MoreInfoAvailable) info = GetInfo(..); if (res == ResultType.OK &amp;&amp; someCondition) something = DoSomething2(..); .... continued </code></pre> <p>versus</p> <pre><code>if (res == ResultType.Failure) something = ProcessFailure(..); if (res == ResultType.ScheduledAndMonitored) something = DoSomething(...) &amp;&amp; DoSomething3(..); if (res == ResultType.MoreInfoAvailable) info = GetInfo(..); if (res == ResultType.OK &amp;&amp; someCondition) something = DoSomething2(..); .... continued </code></pre> <p>Why I think the second one is better:</p> <ul> <li>I don't need to parse the text by eyes - I see the structure of the commands at one glance.</li> <li>I see immediatelly <ul> <li>that there are some ifs and assignments</li> <li>that the enum used in conditions is ResultType and nothing more</li> <li>that only the last condition is composed from two expressions</li> </ul></li> </ul> <p><strong>Update</strong>: this is not a real code. I just wanted to show some example. Consider it like it's an old code that somebody wrote some time ago and you need to read it. Why the first formatting is preferred over the second?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload