▲ | therealpygon 2 days ago | |
Never really understood using a template language when PHP is first and foremost its own template language. I also don’t understand developers making decisions now about things that might one day have to be replaced. It’s like building a bridge, but letting the plan to maybe have to tear down the bridge 50 years later dictate all the design decisions. The fact this happens to lead to more organized and testable code masks the wastefulness in the original goal of such an effort. It simply trades back-side efforts that may or may not ever be required for additional front-side effort with the result of making things easier later if it happens to be needed. I’m not saying it is completely a bad thing, more that it isn’t de-facto a good thing either. I guess, like with all things, the important part is finding the right balance for the situation. | ||
▲ | yurishimo 2 days ago | parent [-] | |
Templating languages in PHP are largely about better ergonomics. Sure, you can have your own helper functions that do the html escaping or an abstraction layer to pass variables into includes without polluting global variable scope, but that’s all boilerplate. Twig and Blade are both fine templating engines with their own quirks and features but they’re also battle tested and have proven their use over the past decade+. If someone wants to use a dedicated templating language for abstracting away chunks of HTML, it’s low on my list of complaints. |