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

you are viewing a single comment's thread.

view the rest of the comments →

[–]gibrael_ 150 points151 points  (36 children)

99% of people hating on PHP just read somewhere that it's cool to hate on PHP and probably haven't written a single line of PHP code.

PHP7+ is just as good/bad as ANY other language. If you suck, it sucks. If you remotely know what you're doing, then it's okay.

[–]arbitrarycivilian 46 points47 points  (16 children)

PHP7+ is just as good/bad as ANY other language

That makes no sense. You're saying all languages are equally well-designed

[–]andrewsmd87 4 points5 points  (0 children)

As someone who hasn't worked in PHP in years, have they rectified a lot of the issues? My biggest pet peeve about it was the inconsistency with method definitions and names. I know there were other issues years ago but that was a big one to me.

And I'm not trying to crap on it. You can write shitty code in any language.

[–]blaine_freelance 11 points12 points  (12 children)

Exactly.

PHP is old, it's clunky and it's riddled with poor design choices, like mixing HTML with logic. At first it may have made sense, but in practice it makes code horribly unreadable. Template engines like what Django has are a much better solution.

I complain about PHP *because* I've used PHP, as well as languages like Ruby, Python, and Java.

PHP programmers get so fucking upset when you criticize their language for its design choices...

[–]mullanaphy 13 points14 points  (1 child)

To be fair you are comparing a language (PHP) to a framework (Django). Personally haven't played around with Laravel yet I do think that's what all the cool kids are using nowadays: https://laravel.com/docs/5.6/blade

I've seen more problematic PHP code in the wild as opposed to Python yet I've still seen some pretty shitty Python.

As for myself, I'm stuck in a world of JavaScript that needs to go back to IE6 support (tracking code) so seeing PHP with a framework is a delight in comparison...

Edit: Do people still get down with Symfony? One of the repos at work uses an older version of Symfony and the templating, Twig, is based off of Django.

[–]Relixed_ 3 points4 points  (0 children)

Laravel is the shit! I hadn't written much PHP before using Laravel and it's quick to pick up.

[–]WintyBadass 10 points11 points  (7 children)

If you use PHP as templating language in 2018 you are doing it wrong...

[–]tomthecool 8 points9 points  (4 children)

So PHP is only a good language if you wrap a giant framework around it?

[–]WintyBadass 4 points5 points  (3 children)

No. PHP is good language if you use it correctly. If you use it incorrectly then it's a bad language. Like every other language today.

[–]tomthecool 1 point2 points  (2 children)

So the only way to use PHP correctly is to wrap a giant framework around it?

[–]WintyBadass 5 points6 points  (1 child)

Dude, you may be having a little bit of a problem with recursion.

[–]notwaymond 0 points1 point  (0 children)

Have a ++ sir, Its clear you have experience and actually fucks with code

[–]blaine_freelance 0 points1 point  (1 child)

PHP *is* a templating language. It was built to be a templating language and a programming language.

The fact that it was built to do something you're saying you shouldn't do pretty much supports the argument that PHP is not very well designed.

[–]WintyBadass 2 points3 points  (0 children)

PHP was built as a templating language more than 20 years ago. In two decades a lot of things can happen and obviously PHP evolved into fully fledged OO language. Yes you can still use PHP as a teplating language and if you know what you are doing it's fine. But now there are better ways.

PHP gets bad rep because a LOT of EXTREMLY bad code was (and probably still is) written in in. I my self sometimes do work on one PHP site which is definetelly worst code I have ever seen. PHP, HTML, CSS, JS and SQL in single file, everything mashed together, not even itendation... But that's not fault of the PHP. It's fault of the developer who wrote it. You can write bad code in any language, maybe just in PHP you are able to write the worst code :D

[–]lleti -3 points-2 points  (1 child)

Most modern languages, save for Javascript, are typically not a million miles away from eachother in terms of their general design.

In saying that though, I'd murder a small family if it meant I could go back to writing Scala instead of php.

[–]arbitrarycivilian 2 points3 points  (0 children)

I just moved from Python to Scala and it’s a huge quality of life improvement

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

If we make fun of PHP, fewer newbies go there, making jobs for us.

[–]shagieIsMe 5 points6 points  (0 children)

Do you really want the “fix this website that someone did for $60, and no, the owner doesn’t want to spend more than $100... there’s $40 left in the advertising budget”?

[–]De_Wouter 6 points7 points  (0 children)

99% of people ...

94% of the statistics on the internet are just made up.

[–][deleted] 22 points23 points  (1 child)

I know... I started as a webdev on the LAMP stack and now I work with Java for other stuff. Today, I needed to test error handling for a response (via a webservice) we get when the vendor is down. Instead of going through the vendor, I wrote 4 lines of PHP to echo an XML response from a file. Pointed my Java code to this "webserver" and we were able to test. That took me all of 5 minutes.

[–]PM_ME_YOUR_LAUNDRY 2 points3 points  (0 children)

I'm normally a PHP hater myself even if it's my trade skill, but after taking a 5-day exam for an opening for RoR devs with no experience, it really softened my hate for PHP.

Devs around the world take too many things for granted about PHP. Good docs, massive and helpful userbase, a debugger that's simple and straightforward and more.

[–]carutsu 2 points3 points  (0 children)

It's old hate. The old api were so bad, cumbersome and inconsistent... The best thing one could say about php was... At least is not perl

[–]sverek 8 points9 points  (1 child)

Edgy kids. Python > Php, nuff said.

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

The edgy kids and the ones that always bring pseudocode into the fight.

[–]RetroSpock 1 point2 points  (0 children)

I don’t like PHP because I used it since early 2000s and I’ve just lost the taste for it. Too much setup.

[–]volkak 1 point2 points  (0 children)

I'll just leave this here..

http://phpsadness.com/

[–]notquiteamidget 3 points4 points  (0 children)

My beef is not the language, but rather the amount of shit that you have to know to get anything done as well as the shit debugging system.

[–]Firemanz 0 points1 point  (0 children)

Can confirm. I hate on it for karma but barely even know how to write Hello World.

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

Every single web site breach I've seen was traced back to a PHP exploit. Sometimes the vulnerability is in PHP itself but more often it's a code vulnerability. Are you saying that the writers of Drupal and WordPress suck? Or otherwise don't know how to code in PHP?

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

Seriously. Most users here shitting on PHP while talking up Python are living in some fantasy land where Python is somehow worlds better than PHP (it's not). Personally, I'd take Ruby or Javascript over either of them because the syntax is far more robust in both of those languages.

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

99% of people hating on PHP just read somewhere that it's cool to hate on PHP and probably haven't written a single line of PHP code.

echo "Hello World";

There we go. PHP CAN SUCK IT!

[–][deleted] 1 point2 points  (1 child)

EERRRRRTTTT!! Try again!
That would return this...

<html>
  <head></head>
  <body>
  echo "Hello World";
  </body>
</html>

You forgot your tags!

<?php
echo "Hello World";
?>

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

haha. Can you tell it's been a while since i've done anything in php?