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

Why would I ever be inclined to use PHP again? It’s only okay for web servers, but with a language like Go or Python I can do a lot more with them.

PHP was an utter mess. Has it changed? I don’t care. It broke my trust and I’ve moved onto languages that are more thoughtful and general purpose. Returning to PHP would feel like returning to an abusive relationship




The Python 2.x to 3.x transition was also quite messy and long-winded but now 3.x rules the roost. Recent and coming PHP versions have done and will do away with much of the evolved mess that the language accrued in the decades. Performance is OK, deployment is easy, it is nearly universally supported, the build system is quite a bit more sane than the spaghetti-ball-like mess around node and friends.

It is possible to use PHP for CLI apps as well but this is a bit of an afterthought:

   if (PHP_SAPI == "cli") {
      # CLI-code goes here
      exit();
   }
It is the right tool for a lot of jobs - not for all jobs but what language is?


The transition was awful but both Python 2 and Python 3 are good languages


...which also have their problems, e.g. text encoding handling in Python 2.x was horrid and full of traps. This is better in 3.x, problem mostly solved. The same goes for many of the warts in PHP which have been fixed or are scheduled to be fixed in 8.1 and later. Given a choice between a world without PHP and one with it, warts and all, I choose the latter. Not because of its elegance or correctness or performance but because of its utility. In this respect it is a bit in the same situation as Bourne/Korn/Born_Again shell, languages which surely could be better in many ways but excel in just being there when you need them and for the purposes you need them.

The language at hand is often the best language for the job, just like that phone camera in your pocket is the best camera to snap that shot of whatever event you just happened upon. Sure, it would have been better if you could use a DSLR on a stand, shooting raw to be processed in some fancy tool but that DSLR and stand and tool generally complicate matters far more than they add in quality. Sometimes this is worth it, often it is not.


For one, PHP generally outperforms Python by a large factor.

Also, to claim trust has been "broken" is just weird. Every software engineer should be well aware of the horrible mess that is the PHP language even if they had just had a cursory glance at it.

In any case. I would never pick PHP on purpose either. Even if it was the most appropriate tool in a given situation. It simply makes my blood boil, and I don't care if it's irrational.


> Has it changed?

Both development team and the community matured and learned a lot. The language lost a few of its footguns, but preserve a lot for compatibility reasons. The best practices evolved in good ways, but the old documentation is still around.

So, yes it changed. If it changed enough is a different question.


> It broke my trust

Can you elaborate on this a bit? What trust did you have in PHP, and what did it do to break that?




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: