all 17 comments

sorted by: hot top controversial new old
[–] 8 points 3 years ago (1 child)

To be fair: If you are chaining ternary expressions, you deserve to suffer whatever pain the language happens to inflict upon you tenfold.

  • source
  • hideshow 2 child comments
  • [–] -1 points 3 years ago (1 child)

    Why?

    It's perfectly readable.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 3 years ago (1 child)

    It is sort of readable. A switch is "perfectly" readable for switching.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 3 years ago* (last edited 2 years ago)

    [This comment has been deleted by an automated system]

  • source
  • [–] 2 points 3 years ago

    The fault is the programmer for not using a switch statement.

  • source
  • [–] 2 points 3 years ago (1 child)

    Sure, it's counterintuitive, but so is not bracketing things in ternary operations.

  • source
  • hideshow 2 child comments
  • [–] 2 points 3 years ago (1 child)

    Hating on php is one of the reasons i left reddit. This is just people who don’t use php hating php for some reason. You can do dumb examples like this for any language. Low effort and funny for children.

  • source
  • hideshow 2 child comments
  • [–] 1 point 3 years ago (1 child)

    Your feelings are valid. I wonder though, would you put up this level of defense for posts making fun of arbitrary parts of non PHP languages?

    You are not your favorite language. And I find most criticisms of most languages to be very valid. I don't think the intent of OP is to insult all PHP programmers. It's okay to like a language that has problems. All languages do.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 1 point 3 years ago

    I'd wager prevalence is part of their problem. Jokes get tired after a while, but that doesn't always mean they stop.

    PHP, like any language, has its problems, but it seems to get poked at a lot more often. But making the same joke over and over has been a problem long before reddit was a thing.

  • source
  • parent
  • [–] 1 point 3 years ago (1 child)

    I get hating on PHP is a meme, and the language certainly has faults, but I feel like it’s no more arbitrary than how JavaScript behaves. And just like JavaScript, if you follow modern standards and use a modern version, it’s a much better experience. The language is only as good as the programmer.

  • source
  • hideshow 2 child comments
  • [–] 1 point 3 years ago

    Finally got it...

    $a == 1 ? "one" : ( ( $a == 2 ? "two" : $a == 3 ) ? "three" : "other" )

  • source
  • [–] 1 point 3 years ago

    Now do CGI.

    Please. I worked with it for five years and I still don't understand it.

  • source