Live data from Hacker News

PHP Sucks

evertpot.com

211–220 of 297 posts

Re: PHP Sucks

#211
post #192
post #179

Earlier quoted context omitted.

I used Yii2 at a previous job. The way that it splits things out feels horrendous. The documentation is sub-par, and I feel like I spent more time trying to figure out why something didn't work the way I expected (from reading the code) than I did fixing things. I'm sure at least some part of that was the previous developer who built the application. But there is absolutely no reason for documentation to not answer t…

My experience has been 100% different from yours. I commonly recommend Yii and laud it's extensive documentation and "Definitive Guide" that covers basically everything. In my current experience as a developer, Yii's documentation is the best I've ever utilized. Much better than any Javadoc I've googled or even php.net's

What are forms and form validation like in Yii? [Have looked at the docs, but after real-world usage]

I've used form libraries from the PHPClasses one back in 2003 through Symfony forms now (which has cognitive overload, and is so flexible as to be restrictive). Most business systems I write are data focused so forms play a massive role in them - and in my developer happiness.

Re: PHP Sucks

#212
post #108

Earlier quoted context omitted.

> And in my opinion, it has fewer ways to sabotage your own project than any language with monkey patching. It's not like rails is the only alternative.

Right, and who's paying me to work with one of those alternatives? No one. My reference for what you quoted was a Rails project written by a Python dev who thought he needed to make Ruby more like Python. The resulting code was so horrendous that I literally cannot tell which of 2-3 parts that compose one feature (all heavily monkey-patched together) is responsible for what. It's like 2-3 complete implementations, bu…

> Right, and who's paying me to work with one of those alternatives? No one.

Give me a break, it's not like there are only PHP jobs out there. If you can't find anything else then it's because you're not capable of coding something that is outside PHP domain, IE basic CRUD apps ..

Re: PHP Sucks

#213

Earlier quoted context omitted.

Give us a break, as a language PHP is a terrible language, and yes I do develop and get paid because of PHP, and I do so for the same exact reason you listed. It pays the bills and does so handsomely too. I have 20 yrs of programming experience in various languages than I care to count, as much as 20! So I do know my languages. From an academic perspective, PHP blows! But from a practical standpoint, it's a tool. It…

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

Yes it is, and I really don't like JS much to begin with.

There's seriously wonky things in there like the associativity on ?: being wrong, and == being even more broken than in js. There's order of arguments on array_map and array_filter being inconsistent. It's not that there's a massive flaw in there that kills it, it's death by a thousand paper cuts.

Re: PHP Sucks

#214
post #157

Earlier quoted context omitted.

>I'm very tired of hearing that PHP sucks. PHP is a good language And I'm quite tired of hearing this silly, totally meritless defense in every single thread that discusses PHP. Can't we just agree that it's not a very good language, but people are still doing cool stuff and lots of money with it? So many pointless fights could be averted like this.

A personal anicdote, but I run a SaaS, and there is an extremely pronounced (negative) difference in the sophistication of technical support queries asked by PHP devs vs those in other languages. This may be because PHP is so ubiquitous and approachable, but these types of silly questions (how do I make a POST call to your API?) are why PHP gets it's reputation.

Yes, the biggest strength of PHP is that anyone can pick it up quickly... which means anyone will. There are "best practices" but they're not necessary to get the job done.

I usually recommend that new developers start with Python. It teaches structure and consistency without as much variation or room to screw up.

Re: PHP Sucks

#215

I wouldn't ever recommend a beginner learn PHP. I would definitely recommend a beginner learn Laravel. It has tremendously awesome free or inexpensive learning materials, great documentation, great community support, and comes out of the box with everything you would need for 95% of websites.

If that's what you're after, you can go with Rails and not be stuck with PHP at all. (Of course, if you go with Rails, you're stuck with Rails, so maybe it's a wash.)

Re: PHP Sucks

#216
post #14
post #2

Is the success thanks to PHP or in spite of PHP?

PHP has always had this hyper productivity about it. You just made a change in your editor, saved the file, and refreshed your browser for rapid feedback. It's always been like that. It's also stateless - less rope to hang yourself with. Many web programming environments started with the same simple CGI model, but eventually moved away chasing performance (for the computer), and leaving behind rapid feedback during d…

> It's also stateless - less rope to hang yourself with.

That's its best feature and I love it.

Re: PHP Sucks

#217

Earlier quoted context omitted.

Give us a break, as a language PHP is a terrible language, and yes I do develop and get paid because of PHP, and I do so for the same exact reason you listed. It pays the bills and does so handsomely too. I have 20 yrs of programming experience in various languages than I care to count, as much as 20! So I do know my languages. From an academic perspective, PHP blows! But from a practical standpoint, it's a tool. It…

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

Javascript ain't that bad, it's interacting with browser exposed api variants that sucks but there are many wrappers to solve that issue.

The real annoying part is that by nature it will never have the same amount of IDE niceties you'd get with more typed languages

Re: PHP Sucks

#218
post #117

Earlier quoted context omitted.

I disagree. Namespaces help hugely, as do Traits, etc. It used to be difficult back in the pre 5.4 days, but we have come a long way since then. Older projects will suffer till they're brought up to spec, true.

In which ways do Traits of all things help write good, disciplined code bases? I think traits, and their Java equivalent, are OK to touch up legacy APIs (as they did with the Java collections API) but I have found no good place to stick them in a new project. Not to say PHP hasn't been introducing functionality for writing good, stable code bases (type hinting in function signatures, namespaces, better garbage collec…

They emitted oplines to the opcode array directly from the parse production.

Re: PHP Sucks

#220
post #85

I started freelancing in my area doing Ruby on Rails, and found it far harder to maintain a project. I also found it harder to acquire clients in my area for new RoR development. More work was available locally with PHP. Clients were more willing to pay. I've done a ton of things in WordPress that shouldn't have been, "to save money". And I've done greenfield development with CodeIgniter, Laravel (v3 and v5), and a c…

PHP, as a language, particularly since somewhere in the 5.x series, is basically "flawed, but still more than adequate."

The real problem is that so many people who use it are utterly incompetent.

When someone says they work in/with PHP you immediately wonder if they're in the "let's duplicate a 900-line function across dozens of files just to give various pages a different icon" camp, the "I call myself a PHP Developer, but all I really do is Drupal Templates" camp, or in the "using Composer and everything is pretty much like you'd expect it to be in any web app built with Ruby or Python or Node" camp.

Until you know, you fear acknowledging them or associating with them. But you can't really ask them up front. So it's easier to just avoid them.

And I say this as someone who occasionally works in PHP.

Post reply on HN