Re:Bedrock: a modern WordPress stack
by smacktoward on Wednesday December 18, 2013 @05:28PM
(#6931338)
And in the WordPress core developers' defense, it has been getting steadily better as time goes on. It's still a long way from perfect, of course, but they're working on it.
things like this need to stop though:
<?php /* pointless comment */ ?>
<?php echo $something; ?><div><?php if($blah){ echo stuff(); ?></div><?php } ?>...
...keeping track of that context switching in a complex theme can be maddening. Especially if it includes inline css and javascript or (heavens forfend) mixes php in with the inline css and javascript...Unfortunately, this is precisely the only thing PHP was invented for. It is a templating engine planned to be used exactly how you quoted.
Everything else is just accidental complexity.
Upshot, though, there's plenty of documentation and SO threads out there and a huge ecosystem of plugins. Most of the time you never even need to look at the actual source code.