[wp-trac] [WordPress Trac] #14598: Minor coding standard flaws?

WordPress Trac wp-trac at lists.automattic.com
Thu Aug 12 16:52:46 UTC 2010


#14598: Minor coding standard flaws?
-----------------------------+----------------------------------------------
 Reporter:  wojtek.szkutnik  |        Owner:                 
     Type:  defect (bug)     |       Status:  closed         
 Priority:  normal           |    Milestone:  Awaiting Review
Component:  General          |      Version:                 
 Severity:  normal           |   Resolution:  invalid        
 Keywords:  dev-feedback     |  
-----------------------------+----------------------------------------------
Changes (by wojtek.szkutnik):

 * cc: wojtek.szkutnik@… (added)
  * status:  new => closed
  * resolution:  => invalid


Comment:

 Replying to [comment:2 filosofo]:
 > Replying to [ticket:14598 wojtek.szkutnik]:
 > > While browsing the WP code I found a lot of minor coding standard
 flaws, like wrong-side comparisons ( "if x !== false instead" of "if false
 !== x" etc).
 >
 > The point of doing those "Yoda conditions" is to be part of a practice
 that catches mistakes ''at the point of code construction''.  After the
 code is written, their value is gone.  So I wouldn't spend time addressing
 them aside from when they're code changed for other reasons, as sribu
 suggests.

 That's the conclusion I came to after opening the ticket. However, I
 disagree with "yoda conditions" being useless after the code is written.
 It makes code more readable and helps avoid more mistakes when any changes
 are needed, so correcting them further along the way might prove to be
 useful. This being said, I close the ticket ;)

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14598#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list