Le jeudi 27 novembre 2014, 11:44:31 Lee Duhem a écrit : > On Wed, Nov 26, 2014 at 7:54 PM, David Mertens <dcmertens.p...@gmail.com> wrote: > > 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.
Agreed. > > 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, Thomas _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel