Hacker News new | past | comments | ask | show | jobs | submit login

To understand that, you have to take a closer look at its origins. For me, this talk by Rasmus Lerdorf (creator of PHP) was a real eye-opener: https://www.youtube.com/watch?v=SvEGwtgLtjA He mentions that what we now refer to as the "PHP language" was originally intended to be only the templating system, and you were supposed to write your business logic in a "real language" such as C. However, as PHP got more popular, bits and pieces were added until the "templating system" became a full-fledged language. Sounds like this happened more by chance than by design. And because you can't throw all of that out, it shows until today. You can introduce new features, but doing that in a way that stays (more or less) backwards compatible is difficult and forces compromises - see type declarations, which are actually just type hinting and of very limited use. So sure, PHP is wildly popular because of its "first mover" status, so it will probably stay with us for the foreseeable future, and working in it may have become more pleasant over the years thanks to better tooling, but it will unfortunately never be as pleasant as in other, more well-designed languages.





That's kinda the problem with any domain-specific language: it either requires a full language for support, or it becomes one (and generally not a very good one). Every language is an opinion about what things should be easy and what things are allowed to be hard.

I've got nothing against DSLs and template languages and such, but most of the ones I encounter make me sigh and say, "I know you thought it would be easier but it's just one more thing I have to figure out how to debug, without any of my usual debugging tools."


> what we now refer to as the "PHP language" was originally intended to be only the templating system, and you were supposed to write your business logic in a "real language" such as C

I did get a little perverse amusement at writing HTML files containing nothing other than single `<?php` element; where that PHP's job was to generate HTML; and it did so via a templating language (e.g. Twig or Smarty)...




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: