[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] [PATCH 4/4] tcc.[ch]: Adjust code style.

From: Thomas Preud'homme
Subject: Re: [Tinycc-devel] [PATCH 4/4] tcc.[ch]: Adjust code style.
Date: Sat, 03 Jan 2015 20:55:34 +0000
User-agent: KMail/4.14.1 (Linux/2.6.38-ac2-ac100; KDE/4.14.2; armv7l; ; )

Le jeudi 27 novembre 2014, 11:44:31 Lee Duhem a écrit :
> On Wed, Nov 26, 2014 at 7:54 PM, David Mertens <address@hidden> 
> > As for the order of value checking, I do not think this is a good idea.
> > These are classic Yoda Conditions and they should be kept that way to
> > encourage the practice, in my opinion.
> I am fine with both of these styles, as long as one of them is adopted
> consistently. Mixing them up randomly just too bad for my eyes.


> It looks like the existing code already chose `var == const` style, I think
> we should stick to it. If we decide to change to another style, that change
> should be made globally.

var == const is by far the most used construct I've seen in all the code I 
looked at and in tcc in particular. It also feel more natural, at least for 
French and English readers: "If the value of var is const". That said I like 
the fact that this construct prevent a common mistake in C. I guess it's 
possible to use this construct when coding and then reversing the order at 
commit time (commit hook?) if one wants to use it. I'd be in favor of keeping 
the status quo to avoid a lot of code change but if others feel otherwise I 
don't mind changing.

Best regards,


reply via email to

[Prev in Thread] Current Thread [Next in Thread]