[wp-trac] [WordPress Trac] #24549: Follow the WP Handbook Standard, and change The Loop of Core Themes to Use Brackets

WordPress Trac noreply at wordpress.org
Mon Jun 10 13:17:39 UTC 2013


#24549: Follow the WP Handbook Standard, and change The Loop of Core Themes to Use
Brackets
------------------------------------------------+--------------------------
 Reporter:  chriscct7                           |       Owner:
     Type:  enhancement                         |      Status:  new
 Priority:  normal                              |   Milestone:  Awaiting
Component:  Bundled Theme                       |  Review
 Severity:  normal                              |     Version:  trunk
 Keywords:  dev-feedback needs-codex has-patch  |  Resolution:
------------------------------------------------+--------------------------

Comment (by nacin):

 As has been pointed out, very few PHP projects even allow if/endif.
 Alternative brace style is largely frowned upon.

 That said, a number of us like it specifically when breaking in and out of
 PHP for long periods of time. This is perhaps an uncommon problem due to
 the fact that our templating engine *is* PHP.

 Just as one example, as loops get more complicated (yet still get edited
 often by people who don't know or understand PHP), it is easier to pick
 out the endwhile than the } at the bottom of the file. Pippin said it
 best:

 > A user that doesn’t understand a single bit of PHP, and perhaps just
 minimal HTML, can clearly read my translation above and understand what is
 happening.

 Are there downsides? Sure, absolutely. But they don't come anywhere close
 to outweighing the status quo.

 The current coding standards are ''very'' basic. A number of core
 contributors follow (or don't follow) a large number of other specifics
 that have not been fully or properly enumerated in that document. I would
 argue that we're simply missing a stated allowance for alternative brace
 style when breaking into HTML — which ideally should be avoided where
 possible, but which is going to be common in themes.

 We're not dealing with "new developers". We're dealing with users who look
 at if/endif, while/endwhile, the_post(), the_title(), etc., and pretty
 much just think that WordPress has its own templating language. They might
 not even realize that what they are coding is PHP. They might not know
 what PHP is.

 Users over IDEs every day of the week. Sorry.

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


More information about the wp-trac mailing list