Hacker News new | ask | show | jobs
by seanwilson 2087 days ago
> I've never got why people escape into Blade, Twig or so on. PHP was designed to have loops, logic, to take variables and so on and interpolate them within HTML.

Compare a Twig theme with a PHP based one. The former is much cleaner because views and controllers are separated, there's clean ways to reuse views, and the syntax is cleaner and more concise for common operations. The standard PHP approach in WordPress gets messy really quickly.

Related, but I can't believe how much responsibility WordPress theme writers have to manually make sure echoed strings are escaped properly (Twig has the same problem because it would be fighting against WordPress otherwise).