Brain Reset and Lack of Twig

2024-03-04


Hey Folks,

You ever have one of those days where you simply forget to do things you've done consistently for months? That's me this week. Not just one thing, but five in a row. I think my brain has hard-reset itself and now I've got to reconstruct the last working-state... 🧠🏖️


Thinking Too Hard

One thing that's always confused me is why isn't Twig more popular than it is as a templating language for PHP? Craft uses it by default, and it's quite good. It helps separate the data from the UI — you can build 'pure' components in Twig that allow you to map data to simple props.

But WordPress ... nope. No templating engine. You can use Timber from the fine folks at Upstatement which adds Twig, but you're opting into a lot more than Twig. It has it's own routing and methods that force you to think differently about WordPress and just what you're doing in there. While I don't agree with all of WordPress's opinions on 'how things should be', I have found that deviating too far from mainline development exponentially increases long-term maintenance efforts. And that's not a great thing to dump on your clients.

So why isn't Twig more popular with as widespread as PHP is? With most things like this, I'm sure there's reasons, I just have no idea what they are. 🤔 Something to spend more time thinking about.


Interesting Web Bits


Don't miss what's next. Subscribe to Net Noodlings with Nathan: