• HakFoo@lemmy.sdf.org
    link
    fedilink
    arrow-up
    15
    arrow-down
    1
    ·
    1 year ago

    PHP.

    It picked a niche and fits exactly into it. It’s a language for server side web pages. It’s not a general purpose language shoehorned into the task, so it wisely sets boundaries. PHP could avoid a lot of async/await/promise hell because you can work in the mindset of HTTP requests-- terms of short lived requests that are compiled elsewhere. You don’t have fragile runtime environments (see: server-side JS), since it just plugs into Apache or Nginx, which are at least battle tested and known quantities to operate.

    It’s batteries included. Hell, it’s the entire Duracell company included. The standard library is rich and centrally documented, including decades of community nitpicks, even before you go into composer repos.

    It’s non judgmental. You can write procedural code, or object-oriented code, based on preference and fit to task.

    It makes ad-hoc easy and formal possible-- If I need an array of [227, “Steve” => “meow”, 953 => new FreightLocomotive()] I can get it, or I can enforce types where it’s relevant and mitigates risk.

    • saloe@lemmy.ml
      link
      fedilink
      arrow-up
      4
      ·
      1 year ago

      PHP really is such a forgiving language and easy to understand and get in to. My favorite part is that every time I have a seemingly very niche and specific use-case, there is a function that just does that thing perfectly and is already included in the base library.

      You said it and I’ll reaffirm: the documentation and online library of SO questions/answers is absolutely priceless. Most of the older versions are still compatible with the latest version, so upgrading is simple and usually just means there are more features you can use now.