Live data from Hacker News

PHP Sucks

evertpot.com

101–110 of 297 posts

Re: PHP Sucks

#101

The thing that hurts PHP the most is lack of structure and patterns used in the most popular projects. These popular projects are usually where the bulk of work lies, where developers point to when they're considering PHP. When juniors start they're typically working on WordPress or Drupal. The problem is that WordPress and Drupal are terrible guides of how to write a web app and that knowledge is completely useless…

I used to like Laravel, but lately it feels so enterprisy. There is a lot of boilerplate in Laravel today and it was changing too fast for me to keep up with it.

Used to love Laravel, until I learned the hard way it is utterly impossible to debug when shit do hit the fan.

Some related discussion here: https://laracasts.com/index.php/discuss/channels/general-dis...

Re: PHP Sucks

#102
post #6

Earlier quoted context omitted.

Facebook wouldn't use it if Facebook started two or three years after it did.

Facebook is using his own PHP, optimized as fuck, so... Tell us what they should have used ? :D

A few years later there would have been Rails or Django. With the strides FB made in PHP it would have been cool to see what they could have done with those frameworks/languages.

Re: PHP Sucks

#103
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…

>> More often it's the programmer who sucks, not the language.

Or the client sucks.

Re: PHP Sucks

#104
> It sucks that every HTTP request is a whole new instance of my PHP application.

In fact, this is one of PHPs greatest strongs, not a weakness! NodeJS, Ruby and especially long-running Java web apps easily turn into huge memory leaks.

PHP, on the other hand... not so much.

> PHP is generally not approved in the enterprise

I believe OP is looking from the wrong angle. There certainly are successful, enterprise-used PHP applications (e.g. SugarCRM, Drupal, Typo3), so it certainly is not a problem of approval.

IMHO the real problem is the total dominance of (extremely!) outdated COBOL/FORTRAN/(other mainframe stuff), SAP and Java (hello Lotus Notes!) applications in business.

Re: PHP Sucks

#105
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…

| More often it's the programmer who sucks, not the language. Whilst it is possible to write structured, elegant php, its very hard, and thats the languages fault. The barrier to entry to write bad PHP is very low, thats what makes people think it 'sucks', because 90% of PHP codebases do. :(

Re: PHP Sucks

#106
post #87

What Evert is referring to (the "reputation" of PHP and people's reactions) is even worse in infosec. I very frequently get accused of being a charlatan simply because I write PHP. Some people openly question if a PHP developer who understands security exists at all : https://twitter.com/MalwareJake/status/506488937096183808 This is silly when you think about it. If so many systems run PHP, wouldn't you want your inf…

My company does penetration testing and most of the projects involve web apps. Our clients use PHP, J2EE and .NET, and after 7 years of operation, we clearly see a trend where the number and severity of security issues are highest in PHP apps, lowest for .NET, with J2EE in the middle. Of course, there's the odd secure PHP app and the .NET project with gaping holes, but the trend is obvious. So it's not peer pressure,…

Please tell me more about these PHP projects, if you have the data available to you.

* Did they support EOL'd versions of PHP?

* Are they legacy WordPress/Drupal/Joomla projects that haven't been updated in years?

* Are they in the "we (didn't use a framework|rolled our own framework) and used the mysql_* functions" league?

* Did they attempt to do something weird/crazy (i.e. store all session state in an encrypted cookie instead of server-side like normal, but forget to authenticate the ciphertext)?

Those are the kinds of things that I rarely find in modern PHP projects.

One thing I think Evert neglected to mention in his post: There's definitely an ecosystem problem. Incidentally, I've been working on cleaning it up on multiple fronts:

* Improving the quality of information developers will find via Google search or StackOverflow

* Writing blog posts that address security concerns e.g. https://paragonie.com/blog/2016/02/how-safely-store-password...

* Improving the security of the tools and frameworks developers use

* Working to improve the language itself (part of the reason why PHP 7's CSPRNG functions don't fail open is because a few of us were very vocal on how/why that would harm security)

Re: PHP Sucks

#107
post #11

Earlier quoted context omitted.

I wouldn't say it is. In asp.net, language is better engineered and will get in your way less often: https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

ASP ? dude really ? PHP get in your way only when your starting. You never make these "bad language mistakes" once you're experimented. And then you can write really clean code. ASP, however, makes me vomit everytime I read a single line. COBOL is more readable !

C# (the most commonly used ASP.Net language) is one of the best designed mainstream languages out there. I'm not a fan of any of the ASP.Net web frameworks, but the language itself is great.

Re: PHP Sucks

#108
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…

> 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, but depending on load order any piece of the 2-3 implementations could be handling it. The client didn't have the time required for me to fix it.

... to quote myself:

> More often it's the programmer who sucks, not the language.

Re: PHP Sucks

#109

I worked at a PHP-based company and after a year of intense interviewing, we finally decided to switch core languages and tech stacks because we weren't attracting strong enough candidates. What we found is that most good programmers didn't want to work in php and most php developers were designers that learned how to code php. But they didn't understand CS fundamentals or even a decent idea how to code. They could c…

[deleted]

Re: PHP Sucks

#110
post #27

"There are only two kinds of languages: the ones people complain about and the ones nobody uses" -- Bjarne Stroustrup

They laughed at Einstein, but they also laughed at Bozo the Clown.

Yes, every popular language has critics, but that doesn't mean they're always wrong.

Post reply on HN