4 ms·
> Other languages require templating systems that won't allow you to dump variables because they won't be in scope in the first place. This isn't true of every
by csande17 7y ago
> Other languages require templating systems that won't allow you to dump variables because they won't be in scope in the first place.
This isn't true of every templating system in popular use. Rails's Action View, if I recall, allows you to stick <%= ENV["THE_DATABASE_PASSWORD"] %> into a template with no fuss at all, and yet Rails developers somehow manage to avoid doing that.
PHP isn't bad because it lets you put code in HTML, it's bad because the default behaviors and APIs it provides make it easy to shoot yourself in the foot. A better, safer language could keep PHP's ease of deployment without its issues. Maybe P++ will be that language and maybe it won't.
- codesushi42 7y agoThat's not the same. I have seen plenty of unmaintainable PHP code that embeds business logic in HTML.