Source.

Yep, PHP is turning 30 this year! Wondering if “PHP is still relevant?” Ever since we have been hearing that PHP is dead. It was “dead” 10 years ago, 5 years ago, and “is dead” today. But somehow - it isn’t. Anyway… happy birthday!

  • rumba@lemmy.zip
    link
    fedilink
    English
    arrow-up
    3
    ·
    16 hours ago

    I personally feel that giving the growing user base things they want is probably the most prudent reason. Constantly refusing to provide simple constructs that are available everywhere else It’s not a good look. In the open source world if you do that shit enough you end up getting forked.

    The context and ease of switch in a functional programming layout is a rather clean implementation.

    Otherwise you end up with the crap like they’re pulling with flask were you just make an unnamed, unindexed number of functions. Can you sort and organize your functions and make everything clean? Sure you can. Does it happen by default? Almost never.

    You can walk up to someone else’s switch and see what the options are. The code flows through that simple construct and it’s very easy to understand someone else’s work.

    I load up someone else’s flask endpoint, It’s just this multi-page stream of consciousness.

    You don’t need switch, But there’s a reason why so damn many people ask for it. Before they agreed to include “match”, They said just to use getattr and write your own switch.

    • PolarKraken@programming.dev
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 hours ago

      I think I agree with you, and I also think you probably know better than me, but - Python couldn’t become what Python became without doing this exact thing very deliberately, bordering on obnoxious at times. Fundamentals or “initial state” define the characteristic strengths and weaknesses for a language, but what to add and what not to, as well as “why” and “how”, over time determine the true shape and user experience (lacking a better word there) of a language.

      Despite its reputation, in my view Python has always been far more opinionated about how to do things than most give it credit for.