Some people think there can be a perfect format for source code, but Dan doesn't think so.
Consider this complex 'if' clause condition:
if ((A.Name==B.Name)&&(A.age>B.age||A.age==B.age))
People with a fixed mindset will put spaces everywhere, similar to this:
if (( A.Name == B.Name ) && ( A.age > B.age || A.age == B.age ))
But Dan thinks it should be situation-based, the point is to make the code clear and easier to read, not rules, he would put it like this, looks better when avoid some spaces for grouping:
if ((A.Name==B.Name) && (A.age>B.age || A.age==B.age))
Dan's way is better with the 3 conditions clearly seen. So there are 2 types of people: Rule-based people, Tactical people😏
No comments:
Post a Comment