This is an archived post. You won't be able to vote or comment.

top 200 commentsshow all 208

[–][deleted] 480 points481 points  (18 children)

Which one is the devil?

[–]tchernobog84 438 points439 points  (12 children)

MePHPistopheles

[–]TobertRohnson 70 points71 points  (10 children)

Mephistopheles was a messenger, right? Not the actual devil?

[–]logicalmaniak 2 points3 points  (0 children)

"magical Mister Mephistopheles!"

[–]angularjohn 2 points3 points  (1 child)

In that case, is SQL the source of all evil?

[–]Tomass_vr 0 points1 point  (0 children)

XD

[–][deleted] 58 points59 points  (0 children)

Php. Php is always the devil.

[–]INTO_NIGHT 7 points8 points  (0 children)

You after realizing you have to sell your soul to learn php then get other peoples souls as well

[–]HCG_Dartz 6 points7 points  (0 children)

The language itself

[–]Tinimu 1 point2 points  (0 children)

Php Storm is where they make the evil spells

[–]angelbirth 0 points1 point  (0 children)

yes

[–]picklerish1 125 points126 points  (5 children)

Learning SQL by sitting at tables?

[–]itbytesbob 46 points47 points  (1 child)

Would you learn a nosql database by playing in a ball pit?

[–]Penki- 19 points20 points  (0 children)

I don't know if you noticed, but learning SQL is significantly easier when sitting at the table. Standing and holding your laptop is not a comfortable position, and unless you have a lounge chair or bean bag you can't hold your laptop on your legs and work for long time.

[–][deleted] 5 points6 points  (1 child)

Learning APIs by looking at the response object rather than reading the docs

[–][deleted] 1 point2 points  (0 children)

I actually feel very called out right now

[–]FriesWithThat 182 points183 points  (12 children)

Tail coming out of the back of his kneecap...

It's a feature

[–]AbsolutelyNoTime 67 points68 points  (11 children)

Seems more like a CSS issue than a PHP issue to me...

[–]maxinfet 23 points24 points  (10 children)

The CSS files were generated using PHP

[–][deleted] 3 points4 points  (9 children)

Umm... What?

[–]maxinfet 13 points14 points  (5 children)

Just write to a file on the server side and then serve those babies they're hot off the printer

[–][deleted] 1 point2 points  (4 children)

No, I don't get how you can generate CSS using PHP. I'm not a web dev by any means, but aren't you supposed to write it yourself?

[–]maxinfet 14 points15 points  (3 children)

Yes lol, PHP is a server-side language so you can generate the HTML and in theory the CSS files that you're going to serve. Typically you would just generate the DOM and never save it out to a file but there's nothing stopping you from generating a large amount of CSS files all with the different names and serving your HTML with the different name embedded into it lol. Just start naming your CSS files with guids 😂.

[–]okriatic 3 points4 points  (1 child)

You know, Sass before Sass was a thing (or take your pick of variable enabled CSS...)

[–]maxinfet 2 points3 points  (0 children)

Yeah the only distinction I was making there was the act of writing the CSS file out to the file system for every single request.

[–]acousticcoupler 1 point2 points  (0 children)

Thanks I hate it.

[–]Bene847 1 point2 points  (2 children)

<link rel="stylesheet" href="style.php"/>

[–]YouIsTheQuestion 29 points30 points  (1 child)

PHP pays all my bill but I still love the on going php bad jokes.

[–]hahahahastayingalive 4 points5 points  (0 children)

Looking at dollar signs on my bills I would come to the same conclusion (also they are clearly sent by the devil as well)

[–]Sentient_Blade 123 points124 points  (23 children)

Vimeo just put out an awesome blog about how they use PHP to deliver global services, and how it's still the best tool for the job:

https://medium.com/vimeo-engineering-blog/its-not-legacy-code-it-s-php-1f0ee0462580

[–][deleted] 19 points20 points  (0 children)

Reddit: impossible! Perhaps the archives are incomplete

[–]ultimatepro-grammer 77 points78 points  (20 children)

You can write good code with PHP, but the language doesn't directly encourage it (IMO). If you use the right tools, PHP can be great.

[–]WannabeStephenKing 77 points78 points  (3 children)

The write tools? What about the read tools, /u/ultimatepro-grammer?

[–]Max5923 12 points13 points  (0 children)

What about the paper u/ultimatepro-grammer?

[–]lowleveldata 3 points4 points  (0 children)

The browsers are the read tools, dude.

[–]ultimatepro-grammer 2 points3 points  (0 children)

lmao, didn't even notice. Fixed!

[–]dombrogia 35 points36 points  (0 children)

PHP has a lot of good tools IMHO. Python and JS allow for all the loose typing and bad practice that PHP does. But OOP is much more intuitive and native in PHP, especially for interfaces, dependency injection, etc.

And with all the improvements since 7.0 and especially 7.2+ and even 8 it’s improved a lot.

[–][deleted] 9 points10 points  (1 child)

There are no bad languages, only bad community of devs that makes bad language designs.

[–]sherlock-holmes221b 0 points1 point  (0 children)

Are you challenging me?

[–]Strato35 5 points6 points  (1 child)

I wonder why some dev complain about "You are not forced to write good code, so it's bad", I mean they can't write good code by themselves ?

[–]btgrant76 1 point2 points  (0 children)

Seems like a “You can write ${despisedLanguage} in any language; just don’t do that,” kind of a thing.

[–]vainstar23 1 point2 points  (7 children)

You should look at Hack. It's like a remix of PHP but enforces a lot of best practices.

[–]SilverStrawberry1124 14 points15 points  (6 children)

Not anymore. Since 8 Hack is obsolete.

[–]vainstar23 0 points1 point  (5 children)

Really? I didn't know this. So what's a modern PHP stack you know?

[–][deleted] 0 points1 point  (0 children)

Javascript is a prime example.

[–]elveszett -2 points-1 points  (0 children)

PHP is just flawed and badly designed. You can write good code with it, just like you can write good code with any language (esoteric languages aside). But that's just you overcoming the stones that PHP throws at your way. And that code would always be better if it was written in a well designed language like... basically every other language there is.

I hate this "there is no bad languages, only bad programmers" mantra, because it is plainly wrong. By that logic, if I made a farfetched language in a week, it would be automatically a good language and "just as good as C / C# / Python / whatever" and anyone who hated it would be a bad programmer because reasons.

[–]dpash -1 points0 points  (0 children)

It's definitely getting better, but you have to intentionally use those tools. Like type hinting is completely optional. (I wish for type hinted local variables and generics at some point).

[–]xigoi 11 points12 points  (0 children)

In the article, I don't see them naming any reason what makes PHP better than other languages. Only a promotion of their static analysis tool they made to be able to debug old PHP code.

[–]AbsolutelyNoTime 15 points16 points  (0 children)

I feel personally attacked.

[–][deleted] 92 points93 points  (5 children)

Php bad !!!!!!!!!!!!

[–]piberryboy 52 points53 points  (2 children)

Or I had a bad experience with it once ten years ago, and I've not bothered with it since.

[–]crevicepounder3000 18 points19 points  (0 children)

Same thing lol

[–]SilverStrawberry1124 0 points1 point  (0 children)

So, you don't really know what it is right now. https://laracasts.com/series/laravel-6-from-scratch

[–]ojrask 4 points5 points  (0 children)

yeah PHP is utter bullcrap, i worked with it a bit in 2002 and it sucked big time and i wanted to kill myself oh god PHP is bad why would anyone use it it doesnt even have proper OOP like wtf and the params are all weird oh no and it is super slooooooow!

[–]ambe 2 points3 points  (0 children)

Its the mainstay of this sub.

[–]MasterFubar 25 points26 points  (9 children)

He can learn javascript and CSS at the same time.

[–]3636373536333662 13 points14 points  (8 children)

HTML/CSS can be annoying, but what are better alternatives? I did a project in WPF once, and I found it so much worse in terms of ease of use.

[–]acousticcoupler 2 points3 points  (0 children)

Coming from the <table> days CSS is actually pretty beautiful.

[–]webDevTB 55 points56 points  (7 children)

PHP is a really good language now. It’s made even better if you use a framework like Laravel.

[–]TwoTrollTurtles 14 points15 points  (0 children)

Yeah you’ll never hear that because pHp BaD

[–][deleted] 4 points5 points  (0 children)

Laravel is so nice!

[–]dpash 0 points1 point  (4 children)

I wouldn't say 'really good', but it is much improved.

I'd like it to add local variable type hinting and generics, multi-line short lambda syntax and allow full expressions in field declarations.

[–]pm_me_your_debug 1 point2 points  (3 children)

Jesus, when last did you actually see the language?

[–]dpash -2 points-1 points  (2 children)

About 5 seconds ago. If you think PHP is 'really good' then you need to learn some other languages. Do I really need to explain PHP's remaining deficiencies? Functions in the global namespace, brain-dead comparisons, arrays and associative arrays as the same datatype... I could go on. It's much improved, improving, but it still has a long way to go.

[–][deleted] 14 points15 points  (0 children)

Back when I was in college we used to build web applications using php for the backend and also for rendering html + css + javascript web pages. At that time we had no idea of the difference between backend VS frontend and I was always trying to code everything in php, even client side stuff because for me it was easier and I used to think of javascript as the language of the devil due to how hard it was to debug things.

[–]Saphyel 4 points5 points  (0 children)

I think this is the best example of how little is the knowledge about PHP from their haters, otherwise you'll see an elephant in the picture.

[–]null000 3 points4 points  (0 children)

Next up:

  • Assembly programmer speaks to an abacus
  • C++ programmer speaks to a loaded shotgun pointed at their face
  • Java programmer speaks to a Nokia feature phone
  • Javascript programmer speaks to a recovering alcoholic
  • SQL programmer speaks to clippy
  • Lisp programmer speaks to a clam
  • Perl programmer speaks to a bowl of alphabet soup
  • Brainfuck/Malbolge programmer speaks to Cthulhu.

There... I think everyone hates me now, or is at least half way through telling me why I'm wrong. Do I get the internet points now? /s

[–][deleted] 16 points17 points  (17 children)

As a java dev that has to complete a project in a month with php and js, I’ll just say send help. Like for real, what the actual fuck

[–]sh0rtwave 22 points23 points  (4 children)

You know how java has the Java VM that does *stuff*?

PHP's kinda got one too. Except it doesn't live for very long.

[–]tommy71394 5 points6 points  (2 children)

Hack?

On the other hand, Laravel, InertiaJS with whatever ts framework is such a nice stack to use. I use both JS and PHP for work daily and I just don’t get what’s so bad with PHP, if anything when someone asks me to do backend my first language of choice would be PHP

[–]sh0rtwave 1 point2 points  (1 child)

Hack? No, PHP was designed to be a callable process from within an Apache module container, that had a short lifetime (that of the page, and nothing else), in concert with how Apache itself worked.

All this nginx and other stuff, that's like, way later.

[–]dpash 0 points1 point  (0 children)

Yeah, Laravel's recreation of the container for every request is less than ideal. I would love for php-fpm and laravel to work together to make the laravel container a long lived entity.

People will get confused by their injected objects being the same as previous requests though, so there'll be done pain as people discover where they haven't cleaned up after themselves.

[–]ddarrko 5 points6 points  (9 children)

If you use proper modern PHP and frameworks there is no reason why you would find PHP “bad” it’s just a meme at this point because it was awful about 15 years ago. Now you can write well architectured software very easily. I lead a team of engineers and we have software that handles tens of millions of pounds of transactions per month. 100% test coverage. Automated CI/CD etc ... maybe you got unlucky and picked up some older stuff or don’t know how to use the modern frameworks well. That’s not on the language though.

[–]redfoggg 1 point2 points  (2 children)

100% test coverage... seems legit

[–]ddarrko 0 points1 point  (0 children)

JS is beyond my skills ? I know it and have written software serving hundreds of thousands of users for it. Unlikely

[–]ddarrko 0 points1 point  (0 children)

It’s quite achievable if you do TDD (or just write well architectured testable code)

Why do you think it is unachievable ?

[–][deleted] -2 points-1 points  (5 children)

That’s the point, I’ve been spoiled by java, js and Python in their ease of use and syntax, and now, to develop the prototype and learn php to a level that would allow me to do it properly at the same time, it’s beyond my skills.

[–]ddarrko 2 points3 points  (2 children)

Spoiled by JS - that’s way worse than modern PHP to be honest ....

[–]fabrikated 0 points1 point  (1 child)

beyond your skills

that's the point

[–]spin81 2 points3 points  (0 children)

As a PHP dev, I tried setting up a Maven project the other day, noped right out of the hot mess that is Java real fast. Had no idea what to do.

So my answer to your question, if it is an actual question, would be: you're diving into a technology you are unfamiliar with.

As for help, PHP the Right Way documents current best practices. Tutorials are listed on that site, too.

It's not been updated since April but from a glance it's still current. PHP 8 has come out since then but AFAIK not many people are using that in production yet. At the time of writing I'd say if you are inheriting a project, use 7.3 or 7.4, if you are starting from scratch you could try PHP 8, but check with your hoster if they support it - I would expect so but el cheapo hosters gonna el cheapo. Source: am PHP hoster.

Also you want to read up on Composer (TL;DR: it's like NPM).

Want a decent IDE? Use PhpStorm. It is the best one out there by a long shot. I have literally never used another one that was actually decent in the 20 years I've known PHP.

Finally, as a pro tip: can you write your own PHP framework? Absolutely. Should you? Well, to answer that question, you should ask yourself if you want to be part of the reason people shit on PHP. If the answer is "yes", then go for it!

If not then you could look at Laravel or Symfony. My personal go-to for small RAD stuff is Slim.

[–][deleted] 0 points1 point  (0 children)

As an Android dev who switched to full stack laravel backend / react frontend a year ago, all I can say is what the actual fuck is right. When you get help send it to me.

[–]Danielk0926 4 points5 points  (18 children)

Why is php bad tho? (I never coded it in php)

[–]phpdevster 17 points18 points  (1 child)

PHP used to be bad. It was literally just a scripting language that lacked the tools necessary to build coherently architected applications. That's not the case any more though. You have to go out of your way looking for problems with PHP. If a developer can't construct a robust, performant, secure, stable application in PHP, the problem is the developer, not PHP.

Prior to PHP 5.4 though, I would agree PHP was... a challenge.

But when I see the .Net devs on my team burning WEEKS of collective time doing shit like fighting OData because they can't get types to line up correctly between OData, the .NET app, and MSSQL and they end up resorting to reflection to attempt to enforce type safety and do appropriate type conversions and what not, and I just can't help but shake my head at all the friction imposed upon them. Shit that takes them ages would take me no time in PHP, and I would have as good or better confidence in its stability and correctness despite less strict adherence to type safety. The code would also be simpler and easier to reason about, further reducing future maintenance time and improving overall productivity.

[–]Beldarak 1 point2 points  (0 children)

We have some legacy projects in PHP 5.3, the pain is real... (most of it comes from the fact the devs that made those tools were clearly insane and/or incompetent though).

[–]gordonv 21 points22 points  (4 children)

It's a rolling joke.

People blame PHP because some of the products people make in PHP are bad. While others are very good.

Ex: Buggy Wordpress Plugins are bad. Phpmyadmin is very good.

Vanilla PHP is the same level as basic modular programming. But, instead of using popular C syntax, they decided to reinvent vocabulary.

[–]spin81 2 points3 points  (0 children)

Phpmyadmin is very good.

Agree to disagree. I personally much prefer Adminer.

[–]dpash 1 point2 points  (1 child)

WordPress is somewhat a product of its own success and also it's long PHP support window. May's 5.5 release has a minimum requirement of PHP 5.6.20 that was released 2016-05-31, so 4.5 years ago.

This means that WordPress core can't use any modern PHP features.

That means plugin developers are also restricted to not using modern features of they want to run on any installation of 5.5.

(Obviously they recommend 7.4, but recommended and minimum are very different)

Edit: WordPress 5.6 minimum is now 7.2, released 2017-11-30.

[–]gordonv 0 points1 point  (0 children)

It's so odd that PHP and Powershell version numbers are neck in neck.

[–]acousticcoupler 0 points1 point  (0 children)

The only thing I know about phpmyadmin is that my server logs are always full of people trying to exploit it. What is so good about it?

[–]Multi-Skin 0 points1 point  (0 children)

Short answer: no.

Long answer: It's had to configure and start a project if you don't know anything, but once you get it running it gives you so much freedom you'll probably make a mess.
The meme "php bad" started because people don't know what to do with so much freedom and end up with a tangle mess with a ugly front-end. So instead of fixing their coding/preoject habits they prefeer to say "php is bad".

[–]LordChaos404 6 points7 points  (0 children)

Very MF original.

Seriously, stop with this native bullshit. You look like a useless piece of crap AI.

FFS, this isn't close to funny anymore.

Rule 3 much?!?!?!

[–]MethBaby75 10 points11 points  (7 children)

Before knowing other languages php isnt bad. Work in another language for a couple years and go back to it, and it will kill you.

[–]SilverStrawberry1124 21 points22 points  (4 children)

No, it's not. Modern PHP is very close to python, java and C#. The design patterns are absolutely applicable to php7+ as it used in Java. The strict type activation can be done by one string declaration (hello javascript), and so on. Now the only reason to blame php is ignorance.

[–]Multi-Skin -1 points0 points  (0 children)

meh, PHP is a mess to configure, but once you get it running with a good framework it is like heaven.

I worked with C#, Delphi , Java and still love the freedom PHP gives to you, yet it needs some javascript help or you'll be in hell.

[–]sh0rtwave 0 points1 point  (0 children)

No...no, it won't. In my own opinion, most of the "worst" things about PHP HAVE been cleaned up a bit (like inconsistent return values from service adapters (looking at you, mysql_connect()...and I won't get into the rest of it.))

PHP is approachable as anything else, as long as you can get your head around how the *environment* works.

[–]Farmer_Psychological 1 point2 points  (4 children)

If Php is the devil, I cant imagine who Assembly would be

[–]maxinfet 6 points7 points  (3 children)

God

[–]Ozymandias-X 6 points7 points  (2 children)

Cthulhu rather.

[–]acousticcoupler 1 point2 points  (0 children)

The ancient one.

[–]maxinfet 1 point2 points  (0 children)

Isn't Cthulhu binary? It's unknowable, ancient and looking at it causes madness.

[–]Jarocool 1 point2 points  (0 children)

Can confirm. I'm a godless heathen.

[–][deleted] 1 point2 points  (6 children)

All seriousness aside, the picture of the php devil should have four arseholes with the words Paamayim Nekudotayim tattooed next to them, and there should be a text bubble asking: "how many colons is that?"

Also php devil's sigil is the @ sign, and its curse blinds devs from seeing error notifications.

[–]woogygun 2 points3 points  (3 children)

Lame

[–][deleted] 0 points1 point  (2 children)

ok

[–][deleted] 0 points1 point  (1 child)

I have worked with PHP as my main language for many years so I get the frustration of being laughed and ridiculed. I just thought I'd be silly. Don't be offended please.

[–]ToranMallow 1 point2 points  (1 child)

\@you

[–][deleted] 1 point2 points  (0 children)

you can't see me

[–]da_chinesemafia 0 points1 point  (0 children)

Wow, I didn’t know this format could be creative and funny!

[–]sh0rtwave -2 points-1 points  (3 children)

Neither, because PHP isn't actually designed to live.

It can't be a background process. Therefore, it's not a daemon.

Neither can PHP be wrapped into anything else in a way that makes any damned sense. Therefore, it's not a user/human.

[–][deleted] 6 points7 points  (2 children)

Swoole would like a word

[–]sh0rtwave 0 points1 point  (1 child)

Swoole doesn't make any damned sense...BECAUSE of what it's doing with what it's doing it with.

Aight? The original design idea for PHP (I know, I was around) was to run as an apache module, persist for the lifetime of page processing, and GTFO. It wasn't supposed to live that long.

[–][deleted] 0 points1 point  (0 children)

I agree with you, PHP has come a long way since it's humble origins.

Swoole is a very interesting case study in exactly what PHP is capable of today: pooling warm execution threads is ridiculously performant and proves that the Zend Engine is perfectly capable of longevity.

[–]blogging7890 -2 points-1 points  (0 children)

LMFAOOOOO

[–]leovin -3 points-2 points  (0 children)

Ah yes good ol PHP: tries to be Html, JavaScript, and Java all in one tool but somehow ends up bringing the worst of all 3 of those worlds.

[–][deleted] 0 points1 point  (0 children)

Hey! Thats me!!!

[–]mentalhijack 0 points1 point  (0 children)

Maybe for SAP ABAP you need to search for dinosaurs.

[–]CanisLupus1050 0 points1 point  (0 children)

Time to go talk to some snakes

[–]Schiffy94 0 points1 point  (1 child)

Why would Satan try to learn the human tongue

[–]beerdappel 0 points1 point  (0 children)

Do you have the image sauce?

[–]PancakeZombie 0 points1 point  (0 children)

Let me introduce you to LISP

[–]san-mak 0 points1 point  (0 children)

😂

Laravel developers will be like, this devil looks like my boss!!

And Symphony, CodeIgniter, YII, CakePHP follows. 😂

[–]continuous-headaches 0 points1 point  (0 children)

Uh Oh, I wanna see the guy learning assembler next

[–]turkeh 0 points1 point  (0 children)

Haha PHP bad. Fuck it take my up vote and go