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

There are edge cases in many languages, there are more in PHP. It would be better to not have the edge cases than to have an IDE that tried to pretect you from them.



I agree with you in most part, just it seems you imply PHP is the worse, I assume you mean is worse then Go,Python ,JS etc. As I said earlier if PHP < Go it does not mean PHP is a dull tool and not suitable for some projects.

If you disagree I am curious of a really example of something that is super hard to do in PHP compared to Python/Ruby/Go , some real world thing. I am aware of the weak points of PHP but I think you can do your job with it, the language is not dragging you down.


I absolutely believe that PHP is worse than many, if not most, other langauges. I have programmed (in a non-trival way) close to 10 programming languages (and fiddled with more) over more than 20 years. Of all those, there are only two that I hate, PHP and Javascript.

PHP (and to a lesser extent JS) are the only languages (that I have experience of) that it seems actively work against the developer writing bug free programs.

Tools reach a point where they can be considered to be dull, and they're not dull before that. PHP in my experience and opinion has crossed that boundary.

> it does not mean PHP is a dull tool and not suitable for some projects.

I think it depends. Should you use PHP for small stuff? one-off's that you run on your home network? I mean, you could, right? No-one's going to access it other than you, so you don't have to worry about user supplied data. But should you use it for Internet facing stuff? Shopping carts, user data? The difficulty is going to be ensuring that you've not coded bugs or security problems into your code, so I would say the answer there is no. I looked, there's been a study (there might be more than one, this was the first result) that has found that PHP is more prone to defects than a lot of other languages (beaten only by c and c++): https://www.i-programmer.info/news/98-languages/11184-which-...

The interesting quote:

"The languages with the strongest positive coefficients - meaning associated with a greater number of defect fixes are C++, C, and Objective-C, also PHP and Python. On the other hand, Clojure, Haskell, Ruby and Scala all have significant negative coefficients implying that these languages are less likely than average to result in defect fixing commits."

This is my experience both writing PHP (lead developer for over a year on a 300k line plus app), and reading it. PHP is hard to write well.

So if you have decided it's not for you with the big projects, why bother with the small ones? They might after all become big projects, but even it they don't, the other languages aren't really that hard. I wrote a Go program yesterday that reads temp and humidity off an i2c bus connected sensor on a Raspberry Pi and writes the data to an influx DB. It is less than 100 lines. It can run from systemd, it uses threads, it's damn fast, and it was even easier to deploy than PHP necause it's just a binary.

It's also far far less likely to have bugs in it.

> If you disagree I am curious of a really example of something that is super hard to do in PHP compared to Python/Ruby/Go , some real world thing. I am aware of the weak points of PHP but I think you can do your job with it, the language is not dragging you down.

You can pretty much do anything in PHP that you can in other languages, it's turing complete after all, but then again, so is the sendmail configuration language.

The issue with PHP is that it makes the task of writing bug free software so so hard.




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

Search: