I learned how to code when I was a kid with a mixture of C++ my dad showed me on our Dell running Windows 95 and PHP that I taught myself in the years after. All through my teenage years into my early 20s, anything I wanted to make I made in PHP. I still have some PHP projects online, but recently when I want to make anything, I set up an API in Python and build the front with a JS framework.
Is part of this just getting in on the latest trend? Definitely. I like scrolling through trending on Github, ya know?
But I was also just tired of writing PHP. Python is cleaner, so if I can do the more complex backend stuff in that, coding is more fun. I would say PHP and JS are about equally “unclean” but if it’s just frontend all those brackets and parentheses don’t become an issue as much.
None of the cleanliness of Python will ever justify the dependency management madness it brings over simply using composer in PHP. It’s not in the same league, not even playing the same game. Give me composer and I’ll get you reproducible installations in CI and prod in three minutes. With Python? The gurus are still discussing the best package manager after the first two days.
javascript is way worse in cleanliness. PHP has the advantage of having been able to break backwards compat and fix some of its worst messes, even down to some questionable soft equalities. Also PHP nicely sidesteps the string addition/concatenation problem by having a dedicated operator for concatenation.
Even better, you don't even need to worry about those backward compatibility breaks if you wrote relatively clean, warning-free code in the first place. Only the very worst parts of PHP's legacy have been thrown out, and only after multiple years of deprecation notices. They've also been following semver quite strictly since 5.3, so you know exactly when to expect breaking changes.
Compared to the Python 2 to 3 mess and the constant churn that today's frontend frameworks seem to suffer from, I would say that PHP is more serious about maintaining backward compatibility than nearly every other language commonly used in web dev.
I'm sorry but if your only reason why PHP and JS are less "clean" than Python is because they have brackets and parenthesis, you're sharing your inexperience, not your experience.
I meant "all those brackets and parentheses" as a synecdoche. I definitely don't mean my opinion to be a comment on any of the actual technical benefits of JS/PHP/Python. Just explaining the reason I've most recently preferred the act of writing one over the other.
Is part of this just getting in on the latest trend? Definitely. I like scrolling through trending on Github, ya know?
But I was also just tired of writing PHP. Python is cleaner, so if I can do the more complex backend stuff in that, coding is more fun. I would say PHP and JS are about equally “unclean” but if it’s just frontend all those brackets and parentheses don’t become an issue as much.
Just one experience.