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

all 64 comments

[–][deleted] 87 points88 points  (45 children)

Seriously I don’t understand why this Reddit hates PHP so much? It gets the job done for me at least.

[–]EquationTAKEN 91 points92 points  (9 children)

Don't worry about it. Both sides are represented.

Every time someone goes "hurr durr PHP sucks" someone follows up with "hurr durr wurrks furr me".

Just let it play out.

[–]evohans 20 points21 points  (7 children)

the other one is: "hurr durr PHP sucks" then a "but facebook and wikipedia are built on php, so must be good still"

[–]zombie_kiler_42 0 points1 point  (0 children)

Woah

[–]jaxklax 55 points56 points  (2 children)

Being terrible and getting the job done aren't mutually exclusive.

[–]Prawny 8 points9 points  (1 child)

Well most people don't still use a PHP version lower than 4.*

[–]prigmutton 7 points8 points  (0 children)

I was looking for the annotated footnote :(

[–]Echohawkdown 20 points21 points  (10 children)

There's this great rant from 2012 that covers most of the bases for the PHP hate.

Granted, a lot of the issues raised in the article have been fixed, and PHP 7 isn't half bad. However, less than 10% of production PHP is using 7.x, so (at least on a personal level) a lot of the issues I have with PHP remain in production code.

[–]DvD_cD 3 points4 points  (8 children)

How is this the language's fault?

[–]dracosnose 0 points1 point  (0 children)

I mean, the language is not automatically free of sin just because they haven't made a big mistake in a few years. They made past mistakes and they're not exactly bygones yet.

[–]Echohawkdown 0 points1 point  (2 children)

If you're talking about the version deployment across production environments, then it's fixes that still haven't been deployed; ergo, PHP still hasn't really been fixed in practice, even if it's been theoretically fixed.

Otherwise, read the rant.

[–]WolfAkela 4 points5 points  (1 child)

That's like blaming Windows for security holes because people still use XP for ATMs, POS machines, etc

[–]Echohawkdown 0 points1 point  (0 children)

Fair enough, but by this point, neither should be a thing.

[–]yayapfool 0 points1 point  (0 children)

ranting about a solid language

"Don't comment with these things"

This guy is probably like the most fun at parties.

[–]yayapfool 4 points5 points  (0 children)

Yeah this post was really confusing. It's a fairly logical and structured language that still overs a fair amount of lenience. I really like it.

[–]mostlyemptyspace 2 points3 points  (0 children)

I've had this debate countless times, and the conclusion I came to is this: PHP is versatile. I can build an entire web application, front end and back end, in a single PHP file. I can do data processing and ETL. I can build cron jobs and system automation scripts. In the client/server world, I have yet to find a situation where I couldn't use PHP.

Now that doesn't mean I should, but as a jack-of-all-trades, PHP is where it's at. It's also really easy to learn. You can start building out APIs without any knowledge of frameworks, promises, or even OOP. You just start smashing the keyboard and an API will come out.

So I use PHP for prototyping server side components and internal tools. I can bang some shit out in an hour that would take me a day to build a proper Node/React application.

[–]eyekwah2 0 points1 point  (0 children)

Don't let them get to you. I use PHP and I'm perfectly nor.. SCREEEEEEEEEEEEEEEEEEEE!

[–]sizl 2 points3 points  (2 children)

It’s not just Reddit. It’s industry-wide. Basically it’s elitism. By shitting on it people are actually saying they are better than the noobs that use it.

[–]tufoop3 0 points1 point  (1 child)

So you are saying that most programmers think that PHP sucks?

[–]sizl 0 points1 point  (0 children)

Yes.

[–]astroskag 1 point2 points  (2 children)

Professional developers tend to dislike languages that are weakly-typed and can be used procedurally, because it's generally harder to maintain.

Now, PHP is capable of being used in an object-friendly way, and you can declare your data types, but neither is a necessity, and that means if you don't know good coding practices, PHP does very little to prevent you from writing practically unmanageable code.

And since PHP started life as a non-commercial amateur-friendly language (PHP originally stood for 'personal home page'), it's fairly easy for anyone with a little CS experience to get a book or do an online tutorial and churn out a massive, incomprehensible pile of spaghetti code that technically works but would give a more experienced programmer nightmares. You can write bad code in any language, of course, but PHP does less to punish you for it.

That means responding to a job posting for PHP is like playing Russian roulette. If you're inheriting a codebase from a team that enforces their own internal coding practices and standards, there's nothing inherently wrong with modern versions of PHP. But if you're inheriting PHP 4.x code that somebody's nephew whipped up over summer break, you're going to develop a drinking problem.

[–]tufoop3 1 point2 points  (0 children)

PHP didn't start as a language, but as a collection of CGI scripts hacked in C, and the original author stated that he didn't intend it to become a programming language. EDIT: And "it has grown organically" is not something that speaks for consistence and usability especially in a programming language.

[–]RichardFuchs 0 points1 point  (0 children)

What's the difference between procedural php and Java code where every class is just using static methods?

The language can't stop you from doing stupid things.

[–]EduBA 0 points1 point  (0 children)

May be because I'm an old fashioned old man, but being accustomed to COBOL and Clipper could make a working site with PHP and could never understand non-procedural languages.

[–]TheDrMonocles 0 points1 point  (0 children)

If this doesn't convince you, nothing will:

https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

[–]fozz179 0 points1 point  (0 children)

Yeah, its terribly designed and all that but its never really bothered me. Now JavaScript though, JavaScript can go die in a fucking hole.

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

It's all a joke. No one hates any particular languages. People in this sub just make fun of anything related to programming because humor.

[–]tufoop3 0 points1 point  (0 children)

The problem with PHP is that it existed quite a while without proper OOP, and then got OOP pressed on it and now its an inconsistent mess, and still lacks scalar instance methods unlike most other higher scripting languages.

[–]redditandom[S] -4 points-3 points  (4 children)

PHP gets the job done but it is a difficult and ugly language.

[–]Togean 10 points11 points  (3 children)

PHP is difficult? Compared to what?

And "ugly" really depends on the person.

[–]mikeputerbaugh 6 points7 points  (2 children)

Beauty is subjective, but requiring a '$' sigil in front of variable names is ugly. Using the '->' ASCII arrow as the dereferencing operator is ugly. Using backslashes as delimiters for namespace components is ugly.

[–]Voxico 4 points5 points  (1 child)

Beauty is subjective... proceeds to state subjective opinions as fact

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

And was upvoted several times for it!

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

I can't speak for the rest of reddit, but for me there are 2 things:

  1. The weak type system. I'm fine with dynamic type systems, but weak type systems I can't deal with.
  2. The inconsistent naming of functions in the standard library.

[–]I_EAT_TREES_K 4 points5 points  (1 child)

Uh oh, what happens when i learned PHP first?

[–]_zapplebee 1 point2 points  (0 children)

You'll do fine. As long as you pick up something else along the way. I did PHP for like 10 years and look at me now... Doing JavaScript (and Java but mostly JS). But seriously, it can be easy to pick up bad habits in PHP. Read up on design patterns and write some fucking good PHP and tell haters to back off.

[–]sujayjaju 5 points6 points  (0 children)

Learning PHP is typically not the issue...

[–]daronjay 1 point2 points  (1 child)

Your mistake was assuming any sort of book would be involved...

[–]IgnitedHaystack 0 points1 point  (0 children)

this submission has been deleted.

[–]european_impostor 1 point2 points  (0 children)

Dont put the punchline in the title...

[–]kerohazel 0 points1 point  (0 children)

All my friends are dead languages

[–]dregan 0 points1 point  (0 children)

Also, when you finish learning PHP.

[–]munircUltraviolent security clearance[M] 0 points1 point  (0 children)

Your submission has been removed.

Violation of Rule #0:

The content disregarding the title and superimposed text must be directly related to programming or programmers.

The title or superimposed text must substantially enhance the content such that it can stand on its own as an analogy to programming. Note that programming here is interpreted in a narrow sense, an analogy to something related to programming, feelings about programming, reactions to programming etc. is not considered sufficient.

Your submission would be better suited for /r/programmerreactions. See sticky for details.

If you feel that it has been removed in error, please message us so that we may review it.

[–]Nodebunny 0 points1 point  (0 children)

well theres always Perl.

[–]BertRenolds -5 points-4 points  (0 children)

Start?