Stop Using Dumb Tools
Back when I learned to code, there was no AI, there was no auto complete, there was just stack overflow. And you know what? That was okay. I find it far easier to learn by reading how things work, running into a problem and then having to manually fix it by searching through forums and question boards. While yes, this was slow, it was good. Developers had to take their time making things. You really did need to learn to code. You wrote bad code, you found out why it was bad, and you improved. These forums were the life blood of the software world.

But with the rapid explosion of AI in the workplace for developers, things have started getting messy. Now, I'm by no means an AI hater, this website originally started because I made a training loop for a sentiment analysis model and I needed training data. Originally, the senta demo was just an internal tool for my boyfriend and I to come up with emotional sentences with classifications. So, I understand why these tools are popular. They are powerful, they speed things up, and they lower the bar for developers to work on projects.
But here is the problem. Developers are lazy, and the best developers are the laziest. They are incredibly knowledgable, and have made tools and workflows so they work as little as possible. That in itself is fine in moderation. But in the few weeks I have been a professional developer, I have ran into the same issue over and over again, and it is enraging.
Dumb Tools To Fix Dumb "Problems"
So, what am I talking about? I'm talking about tools and templating engines like Twig. Now, I have no gripes with Twig itself or their developers. They are truly brilliant people, far smarter than I am. However, the idea of it is dumb to me. I understand why you would want to make templates, I understand what the appeal is to what it does, but I have to disagree. Verbosity isn't bad. I use two languages primarily, PHP and GO. These are my weapons of choice, and they've served me well. PHP is actually a decently flushed language now, and it runs the majority of the internet, GO is a very efficient, very verbose language. And yes, when coding, a language that is very verbose can look cluttered, and if written wrong, can be hard to read. But I'd argue that for a halfway decent developer, that isn't really a problem. And that is where the distain comes from.
The company I work for is a contractor. They work to build software for other companies, and some of these companies are high volume. Now, for a static site, just raw HTML, CSS, and maybe some JS, high volume isn't a problem. You can fire out a beautiful site in a day or two, maybe longer if it has a complex layout. The major benefit is maintenance is basically zero. On the other side of the equation are dynamic sites. Pages that need content to be updated is where things start to get tricky. Now, the most common solution is a CMS like Wordpress. Wordpress is very powerful. Non-technical users can spin up on services like SquareSpace, Pressable, or for those that are a little more DIY, literally any vps service.
Wordpress is one of those examples of a tool that makes developers lazy. It takes most of the work out of development, and as such, creates a detach from code. But then you add a templating engine to your templating engine like Twig, and now you have a nightmare.

I recently got the fun task of updating a couple of sites that were old and very undermaintained, they needed a lot of love and support. Some plugins were literally years out of date, and PHP depreciation errors from pre 7.2 code. This task is a nightmare, now yes it could be worse. It could be much worse. But many of the problems I ran into could have been avoided if we followed one simple priciple to begin with. Don't stack laziness on top of laziness. Instead of using a templating engine, just spend the little bit of extra time to make your own templates, in normal PHP, so everything is readable. Now, I had never heard of twig before a couple days ago. And the fixes weren't really that hard to implement, just time consuming. But what is the real problem with just writing "htmlspecialchars($this_is_easy)" instead of {{ $this_is_easy || escape }}. You save a few characters, but now you have to maintain this extra layer of abstraction. Another selling point is default text is easier. Once again, it's not that much easier.
## Raw PHP
if (!empty($var)) {
foreach ($var as $item) {
echo htmlspecialchars($item);
}
} else {
echo 'No data found';
}
## Twig Example
{% for user in users %}
* {{ user.name }}
{% else %}
No users have been found.
{% endfor %}
An extra two lines of code if you're including the lines that have only curly braces, and better yet, it is far more obvious what it is checking. Now in Twigs example, it is pretty clear what they mean, but my reasoning is still valid. Additionally, after going through these .twig files and reading what they do, most of them are just a few lines long. There was never any reason to use twig in the first place. It just muddies the waters and makes cleanup that more difficult.
So What's My Solution?
Be lazy, but put in the work to be lazy. Make yourself the templates in just normal PHP, GO, JS, or any other language (since these sort of "tools" exist for everything). Use the language as intended that way you, and anyone else who ever has to look through it understands what does what. And understand when and where to run your own tooling. PHP is such a simple language at the low levels that I feel there is zero excuse to ever use tools like these. I could be dead wrong, I'm not trying to be the newbie that comes in with a million billion ideas on how everything is stupid and my way is better. But I seriously fail to see the gain in this. It's almost like going serverless. For most use cases, a $5 nanode from Linode is a better solution. You can do what I did and roll your entire web app into a container stack, you can make it with an inferior language like JS if you feel like wasting memory. Or run a simple site made with just HTML and host it with Apache or Nginx.
It is of my opinion that we've gone too far and need to start putting our foot down. There should be no shame in making things like Twig. In fact, I'd incourage it. JS owes so much to talented developers like Jeremy Ashkenas who created tools like Backbone and Coffee Script. These tools shapped what JS is today. But what Jeremy added was features. He added premade functions to make life easier for developers, to make his work easier. Tools like Twig don't make your life easier, they don't speed up the process, and they don't add anything, they just take existing functions and reskin them. But maybe I'm wrong, maybe I have looked at this the wrong way from the very begining. To me, everything is a learning opportunity, if I am wrong, tell me how and why. I'd love to have a chat about it and understand where I've gone wrong!
Comments