Hacker News new | ask | show | jobs
by rezonant 845 days ago
> If you need guard rails to keep you from performing database manipulations in your views you have other problems to worry about.

Those problems are called "junior developers", and I think we'd all like to avoid them, but that's not very sustainable.

Perhaps we can fix the education problem, but given that folks just do a boot camp and head into the market, prospects aren't looking good.

> Also I don't see how using a loop or conditional in PHP is any different from using one in a templating engine, aside from the overhead of the engine and added annoyance of debugging another language in your project.

The problem is convention, or lack thereof. Without convention, who's to say where that database call should live? Frameworks, which tend to use templating languages for this reason, tend to make that convention clear to all teammates.

I want to mention that this doesn't mean you can't use PHP as the programming language for your templates as long as the conventions are clear, but PHP is poorly suited to being a template language for reasons I've posted elsewhere in this thread.