Live data from Hacker News

PHP Sucks

evertpot.com

81–90 of 297 posts

Re: PHP Sucks

#81

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…

What did you end up switching to?

Re: PHP Sucks

#82
post #8

I used to feel the same way a lot of times, a shame it seems for being a PHP dev. Now, I don't care. I've been using it since 1999, and I use it to get stuff done. My customers and users of my applications don't care what it's written in. But, you should definitely learn more languages as a programmer. > And to anyone considering programming as a career, or trying to get into it... stay away from PHP. This is the par…

This is the point. The language is fine, the technical problems are solveable.

The stigma remains. All other things being equal, choose a language where you're not going to have to fight this fight.

Re: PHP Sucks

#83
post #42
post #12

Earlier quoted context omitted.

That's right they'd probably be struggling to scale Ruby on Rails like Twitter who started 2 years after facebook.

To be fair, FB struggled to scale with PHP, although it certainly fares better out of the box (even then). A lot of their work has gone into making PHP more performant and better by way of Hack. PHP7 took a lot of great ideas from Hack but is still saddled with its legacy.

They did? I remember numerous Twitter outages due to scale and the infamous Fail Whale. Twitter's issues risked the company losing users or even it's sustainability as a business.

Never remember Facebook having much issue.

Re: PHP Sucks

#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 customized set of the Symfony components. I've also maintained and improved brownfield projects that were outsourced.

I'm very tired of hearing that PHP sucks. PHP is a good language. And in my opinion, it has fewer ways to sabotage your own project than any language with monkey patching. PHP7 looks really awesome, and the community has been upgrading quickly toward it. PHP has always had best-in-class documentation in my opinion.

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

Re: PHP Sucks

#86
post #64

I'm by no means an expert on PHP but whenever I begin having similar thoughts like the author, or begin having internal language religion wars in my head about PHP, i remember that PHP actually stands for "PHast Prototyper" (language/platform)..and tools/platforms like that have their place in the world to help us...and then this thought allows me to regain my peace and progress forward on my day (focusing on bigger…

Except that it doesn't. It originally stood for Personal Home Page, and was changed at some point to the recursive PHP Hypertext Processor.

Re: PHP Sucks

#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, we actually have data to back this up, and if you think about it, the whole thing boils down to motivation. Sure, you can write secure and insecure code as well in any language/environment. But defaults are powerful, and it makes me feel sad every time I have to write in reports that "you should've paid attention to opt-in to the secure solution every time you do X" vs. when we do demos to developers and we have to work really hard to disable every protection built into ASP.NET. (And no, I don't like Microsoft at all.)

Re: PHP Sucks

#88
post #6

Earlier quoted context omitted.

Well.. people that don't know how to code but want to hack in a 1 line dynamic thingy.. where else would they turn? It build a pretty good community for newcomers. Now as to why a facebook would use it? mindblown

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

Facebook wouldn't likely exist if it wasn't for PHP. Zuck wrote something quickly in what he knew. They were able to deploy quickly, scale quickly, etc. Internally, they likely had the hope to migrate off of it at some point, but the business goals trumped the tech stack. From an outsiders point of view, no one cares about the tech problems they face with their tech stack.

Re: PHP Sucks

#89
I agree with the sentiment that, compared to other languages, all else being equal, PHP-the-language sucks; and also agree that all else is not equal, since PHP has a massive installed base, infrastructure support, etc., and that the balance can often tip either way. My first programming job was in PHP, which was used only because of its ubiquity on shared hosting (we even maintained support for PHP 4, when PHP 5.3 was current).

Personally, I don't see much point in arguing the merits of PHP compared to, say, Python, Ruby or Javascript, since those languages are so similar: procedural scripting by default; opt-in use of OO as the happy path for most libraries; functional programming possible, but an uphill struggle WRT APIs, tailcalls, language cruft, etc.

There's also a lot of interbreeding in those language's ecosystems, so there's rarely a killer library/framework/app in one which doesn't have a few carbon copies in the others. I would recommend developers in those languages look at what the others are doing, but I don't see much point in switching between them as an end to itself; go for it when convenient, but nothing much will change (e.g. I was heavily into Python, but fell into PHP dev roles commercially).

The more interesting comparisons are to be made with languages/ecosystems which have a different philosophy, e.g. Java/C#, Haskell/ML, Lisp/Scheme/Lua, C/Go/Rust, C++/D, Smalltalk, Forth, etc. Those kinds of comparison have meat; they're not just bikeshedding about which syntax to write imperative procedural/OO scripts in. I commend the author's choice of learning Go (although I'm not familiar with it myself).

I think the procedural/OO scripting languages will be around for a while to come, but I think their niche is in public-facing applications (usually Web sites, but Python certainly has a heritage of desktop GUIs and CLIs). Certainly the use of REST services is making it easier to use languages for those jobs they're good at; for example, using Go for data crunching, while Web site rendering is done in PHP.

Re: PHP Sucks

#90
post #62

Earlier quoted context omitted.

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.

Have you tried Yii at all? In my most recent (side) project, I'm doing a Yii2 website and I'm feeling like it's not enterprisey enough. I have to go out of my way to figure out the best way to split things apart (which, I guess is good because it doesn't actually make that difficult for me at all - it's just something I have to choose to do)

No I haven't and I probably won't, since I don't do php anymore :)
Post reply on HN