[wp-trac] [WordPress Trac] #41217: WP_Community_Events Disable Event Logs

WordPress Trac noreply at wordpress.org
Thu Jul 27 15:36:05 UTC 2017


#41217: WP_Community_Events Disable Event Logs
----------------------------+-----------------------
 Reporter:  Howdy_McGee     |       Owner:  iandunn
     Type:  enhancement     |      Status:  accepted
 Priority:  normal          |   Milestone:  4.9
Component:  Administration  |     Version:  4.8
 Severity:  normal          |  Resolution:
 Keywords:  has-patch       |     Focuses:
----------------------------+-----------------------
Changes (by iandunn):

 * owner:   => iandunn
 * status:  new => accepted
 * focuses:  administration =>
 * component:  Widgets => Administration


Comment:

 Replying to [comment:4 voldemortensen]:
 > 41217.2.diff simplifies that conditional.

 This is minor and maybe just personal preference, but I think the early
 return is a bit more readable than putting the logic inside the `if`.

 It avoids an unnecessary layer of indentation, and separates the
 function's pre-condition from the function's core logic (both visually and
 mentally), so that they're smaller and separate chunks. I think that makes
 it easier and quicker to mentally process them when skimming the function,
 at least for me.

 It also keeps the diff much smaller and targeted to the exact change
 that's desired.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41217#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list