CodingGuidelines: Add a note to avoid assignments inside if()

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Miklos Vajna 2008-05-23 01:26:09 +02:00 committed by Junio C Hamano
parent 633f43e1f7
commit 0b0b8cd7c2

View file

@ -89,6 +89,8 @@ For C programs:
of "else if" statements, it can make sense to add braces to of "else if" statements, it can make sense to add braces to
single line blocks. single line blocks.
- We try to avoid assignments inside if().
- Try to make your code understandable. You may put comments - Try to make your code understandable. You may put comments
in, but comments invariably tend to stale out when the code in, but comments invariably tend to stale out when the code
they were describing changes. Often splitting a function they were describing changes. Often splitting a function