On 8/13/19 4:47 PM, Richard Hipp wrote:
> On 8/13/19, Jose Isaias Cabrera <jic...@outlook.com> wrote:
>> I see all of you smart programmers using this
>> non-column matching behavior, and I ask myself why?
> Because that's the way Dennis Richie did it.  :-)

There are many ways to format code, and many programmers have a strong
preference to the way THEY want it. In many ways this choice is a bit
like religion, sometimes hard to really explain why, but often the
believer has some ideas about it, and the choice is often firmly held
and hard to change.

I personally like the K&R style, as it is compact and dense, so you can
see more code. Some people dislike it for much the same reason.

While the braces don't align, the closing brace does align with the
beginning of the statement it is closing, and there is nothing else in
that column between so scanning up to find it isn't that hard (and then
to the end of the line to see the opening brace).

If the distance is long, I will add a comment after the closing brace
describing the start statement to make it easier to match.

Yes, this format makes it harder to see mismatched braces, but by
compiling often you get a syntax error with miss-matched braces, and
letting your editor find matching braces it tends to be fairly quick to
locate it. The key is to compile (or have the editor syntax check) often
enough that you can't make two opposing errors like this that hide each
other.

-- 
Richard Damon

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to