[vlc-devel] [vlc-commits] mjpeg: Yoda code usage avoiding you will

Rémi Denis-Courmont remi at remlab.net
Mon Sep 24 22:26:24 CEST 2012

Le vendredi 21 septembre 2012 18:23:47, Hugo Beauzée-Luyssen a écrit :
> vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Fri Sep
> 21 17:16:00 2012 +0300| [efd7d3f6518c3917231618e72f131cfa78f3fa48] |
> committer: Hugo Beauzée-Luyssen
> mjpeg: Yoda code usage avoiding you will

I don't follow that practice myself. But I can see the point and I don't think 
it deserves being ridiculed. It has one big advantage. If there is a single 
equal sign, the compiler will bark on "if (0 = x)", instead of emitting a 
warning and unintended code on "if (x = 0)".

Rémi Denis-Courmont

More information about the vlc-devel mailing list