> A trap I can tell you about from recent experience. :)
If it's not too much to ask, please share your experience briefly. Like me, a lot of folks here would be interested to hear your thoughts on this topic.
The worse downside: There is a lot more crappy PHP code out there that novice devs will copypasta than there is for other languages. This makes it harder for novices to find the non-crappy PHP code in order to learn from it.
As a result, it is not particularly unusual to come across a PHP app that has been in production (and maintained!) continuously for nearly a decade that have all the SQL and JS inline, for example.
Would an appropriate compromise be to recommend "if you're going to learn with PHP, make sure you use a framework" since using any of Symfony/Laravel/Cake/etc will guide/force you into slightly better habits than writing PHP from scratch would?
Part of the downside I was trying to convey is that a lot of the PHP work available is maintaining or fixing truly horrible applications, and that while skilled PHP developers are as productive as skilled developers in any other language, unskilled/novice developers are much worse as a consequence of learning all the wrong lessons from random code examples that they find through search engines.
It is actually quite difficult to deliberately create a web application in Python that is as bad as one of those "shopping cart with all the HTML, SQL, JS, and CSS interleaved in a single PHP file" examples that a novice will find and learn from. A novice is highly unlikely to manage it through ignorance even if they somehow manage to avoid using a framework.
I think as a PHP developer I jumped to defending PHP without understanding the nuance you were aiming for, sorry about that. I definitely agree with what you're saying.
No worries, the particular cause-and-effect nuance is subtle enough that a lot of people misunderstand it, which suggests that my phrasing is at fault.
And while the attractive nuisance of PHP's Turing-completeness that encourages those anti-patterns is annoying, it isn't entirely unique:
The platform I cut my development teeth on in 1998 (Zope[1], written in Python) also had a template language that was Turing-complete called DTML[2]. It was a painful transition for the community to deprecate DTML in favor of the new Zope Page Templates (ZPT)[3] that implemented a deliberately less powerful syntax[4][5].
The advantage of a less powerful template syntax is that it forces all "business" application logic (as opposed to "view" logic) out of the templates and into Python code.
Unfortunately, for deployed applications this was a lot of extra work that could only be justified in terms of increased maintainability, which was an even harder "sell" to managers back then.
Can you explain how the downside is way worse?
> A trap I can tell you about from recent experience. :)
If it's not too much to ask, please share your experience briefly. Like me, a lot of folks here would be interested to hear your thoughts on this topic.