4 ms·
> If PHP is a bad language, your complaints are just just irrelevant I don't really understand what you mean here. > I could probably find some bad code base
by wlll 6y ago
> If PHP is a bad language, your complaints are just just irrelevant
I don't really understand what you mean here.
> I could probably find some bad code base made in Go and prove that Go is bad.
"It is possible to write bad programs in PHP and also in Go, and therefore the languages are the same"
YOu can write bad code in all languages, but PHP makes it harder to write good code.
> The things is that from your comment it shows you have no idea what you are talking about
Yes, my 21+ years of experience writing code in over 10 different languages, including a decent amount of time writing PHP, pretty much means I don't know what I am talking about.
> I suggest you let people with experience in PHP to explain hat are the issues and how to work around them.
<raises hand>
> What I could complain about PHP are small things I do not feel that I need some feature from Java or C#
I am not talking about features. In fact, Go has a surprising lack of features, it's one of the things that makes it pleasant to write, and easy to write well.
- simion314 6y agoI mean your proof is I seen PHP code then conclusion is PHP is bad. You are trying to compare PHP with Go, probably Go is better then PHP, but if Go is better that does not mean PHP is bad, just that Go is better (probably not for all use cases). So you have experience with PHP, probably are you thinking at html code mixed with PHP code? yeah that thing is bad but only news use that for large projects. If you do not mean that then I am not sure what PHP issues prevent you to write good code.
- wlll 6y ago> I mean your proof is I seen PHP code then conclusion is PHP is bad. You're over simplifying my point to make yours. I have seen bad PHP code. I have seen bad Go code. I have seen bad code in many languages. The proportion of bad PHP code however, is higher in PHP, for the reasons I've stated around edge cases and the difficulty in reasoning. > You are trying to compare PHP with Go, probably Go is better then PHP, but if Go is better that does not mean PHP is bad, just that Go is better (probably not for all use cases). Go being good doesn't make PHP bad, and PHP being bad doesn't make Go good. I'm not saying one thing is true because the other thing. I'm saying that PHP is a bad language. > So you have experience with PHP, probably are you thinking at html code mixed with PHP code? yeah that thing is bad but only news use that for large projects. Nope, you're making untrue assumptions about my experience. The largest project I worked on was over 300,000 lines of PHP and used templating. It controlled everything from a companies finances, to printing plate layout, to believe it or not, sorting robots on a conveyer belt. > If you do not mean that then I am not sure what PHP issues prevent you to write good code. I've talked about this. Edge cases and the inability to reason about the code. In PHP there are a ton of weird little behaviours or edge cases that you just have to know about that could cause bugs. It's hard to know all of these, and even if you do the sheer number of intricacies of the language means that it would be easy to miss some. PHP isn't alone in this. Go has little gotchas, Ruby has a fair few, Javascript has plenty, but PHP has loads.
- simion314 6y agoLink me to those edge cases please, I did not hit that many so I should be prepared. Thanks.
- wlll 6y agoHere's some that are utterly trivial to find. There are plenty more. Feel free, as a supposedly competent PHP programmer, to go and find the rest, becayse you definitely need to know about them to be able to write code that's going to work properly. Moved the examples to a gist due to HN formatting: https://gist.github.com/wjessop/0923e0667d7dd53ae0503459894e641c https://gist.github.com/wjessop/0923e0667d7dd53ae0503459894e...
- simion314 6y agoThis gotchas are similar to JS or Python ones. I hit more issues related to php configuration or server configuration then language issues, maybe because I use a good IDE that will prevent such trivial bugs.
- wlll 6y agoThere 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.
- simion314 6y agoI 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.