Live data from Hacker News

PHP Sucks

evertpot.com

291–297 of 297 posts

Re: PHP Sucks

#291
post #282

Earlier quoted context omitted.

That, and I've noticed that the typical legacy PHP codebase is worse than the legacy codebase in other stacks.

I have seen some real crap in Python recently. Then I was asked to move a PHP app to a new server. A quick look at the code looked terrible - string concatenations for all the SQL. (Does PHP provide some way of making this safe, or should I warn management about potential SQL injection? I don't know a lot about PHP).

PHP absolutely has right ways to do parameterized queries.

Take a glance at http://www.phptherightway.com/ to get started

Re: PHP Sucks

#292

Earlier quoted context omitted.

It's not hard to write structured elegant php, that is horseshit. Please look at code for symfony or laravel. Hell, my annoyance with writing good code in PHP is that it ends up looking like Java, which begs the question, why not just do it in java. https://github.com/symfony/symfony/tree/master/src/Symfony or you can look at simpler sample codes I wrote for a class in design patterns with php https://github.com/segm…

Symfony is the worst thing that could've happened to PHP. Dependency injection with varying degrees of XML/YAML madness everywhere. It's terribly slow and pretty much unusable w/o several caching layers in front. I can honestly say that I hate this framework with a passion, and the language too. PHP's core and a big part of the community is copying features and methodologies from Java, but they will never get close t…

I won't say it's the worse thing, it did bring some good and really help drive plenty of new projects towards being OOP. I'm no fan of it either! My point is that the code is structured! Now is the framework architecture good? Whoops, that's another discussion, and I can't likewise stand the layering upon layering of components and configuration nightmare.

Re: PHP Sucks

#294
post #76

"Developers who more-so live in the Java-dominant corporate bubble" That's me but ... I've known quite a few good PHP developers like this author. I've also seen horrible, horrible things - things that other languages and frameworks simply won't let you do. A language that gives you a lot of slack also gives you more opportunity to hang yourself. There's nothing that says you have to hang yourself. As mentioned, the…

this. when i evolved from the procedural mess that were tutorials and books, even, i watched most other programmers and/or collegues staying behind. embedded php worked for them. little bit js here, css there... up to this day people just don't evolve from php.

and then there's the other extreme. the overly scientific who brings all sorts of crap into the language or the frameworks. it's justsuch a shit show.

Re: PHP Sucks

#295
PHP is not worse than Ruby, definitely.

Composer is not a new wave but piece of shit which brings old shit-code style with rules "don't touch it while it works" and "legacy code is a good reason for bad architecture".

And Golang sucks too.

Re: PHP Sucks

#296
post #251

Earlier quoted context omitted.

Is it any worse than Javascript, if we're honest?

PHP is like Javascript in that both languages are now being used to do what they were not designed for.

In my opinion JavaScript is being used exactly what it was intended for now more than ever. It was originally supposed to be based on Scheme (an elegant functional language) and after many years the trend of functional reactive programming has finally become mainstream.

I find it quite sad that most PHP developers seem to think that writing code that looks more like Java is the "correct" thing when its greatest features have always allowed loose types and first class functions. After all that's what makes it so easy to work with?

Perhaps PHP could have been more like Scala a few years back already.. the perfect combination of Objects and Functions...

Re: PHP Sucks

#297

While RoR, Python, NodeJS et al don't solve the most annoying issue for every developer: Deployment. Then they don't solve anything. And don't start talking about docker... that's a patch/hack to a serious problem, if i need an entire "jail manager" just to run your app then deployment is not as easy as you kins think it is.

You should be running PHP in a jail as well though. People just don't.

There is a big difference with the word "should" and "need". While i should run PHP in a jail, it doesn't mean i need to. While with python, nodejs, ruby et al, i need to otherwise it becames a dependency mess for every app on the same server.
Post reply on HN