¿Es PHP realmente un mal lenguaje?
Yo le enseño PHP a mis estudiantes, considero que es un buen lenguaje/plataforma para aprender los conocimientos básicos del desarrollo web. Sin embargo, PHP tiene muchos enemigos y reconozco que no es un excelente lenguaje/plataforma, debido seguramente a la forma en que se ha desarrollado. Sin embargo, la razón de los comentarios negativos se encuentra en lo siguiente (If people consider PHP a bad language, what’s the alternative?):
The reason that PHP is a bad language is that it’s so easy to learn the basics – which makes it easy for people who don’t understand programming to learn PHP … and write totally insecure programs. SQL injection is horrible, trivial to prevent, but a lot of people still use msql() functions in older installations. There’s no reason not to – if you understand what you’re doing but I guess that so many people don’t that they had to take the whole thing out of version 7. (Mysqli() functions aren’t that much better, PDO is almost inherently safe, but it’s still easier to stick with what you’ve been using for years – even if 10 year old can hack into the resultant site.
The alternative isn’t a different language if you’re comfortable writing PHP code, the alternative to writing bad PHP code is to write good PHP code. C++ is a good language too – yet you can still write terrible code in it. Some people suggest Python. You can write insecure sites in Python too, if you don’t watch what you’re doing.
Security is something the developer does, it’s not something in the language.
Es decir, una de las ventajas de PHP, que sea fácil de aprender y sea elegido como plataforma de iniciación para mucha gente que quiera aprender el desarrollo web se ha convertido en su mayor “enemigo”.
Deja un comentario