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?
I'm asking because for me it's much more readable.
Examples (not real code):
if (res == ResultType.Failure)
something = ProcessFailure(..);
if (res == ResultType.ScheduledAndMonitored)
something = DoSomething(...) && DoSomething3(..);
if (res == ResultType.MoreInfoAvailable)
info = GetInfo(..);
if (res == ResultType.OK && someCondition)
something = DoSomething2(..);
.... continued
versus
if (res == ResultType.Failure) something = ProcessFailure(..);
if (res == ResultType.ScheduledAndMonitored) something = DoSomething(...) && DoSomething3(..);
if (res == ResultType.MoreInfoAvailable) info = GetInfo(..);
if (res == ResultType.OK && someCondition) something = DoSomething2(..);
.... continued
Why I think the second one is better:
- I don't need to parse the text by eyes - I see the structure of the commands at one glance.
- I see immediatelly
- that there are some ifs and assignments
- that the enum used in conditions is ResultType and nothing more
- that only the last condition is composed from two expressions
Update: 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?