8 votes

Thoughts on PHP routing strategies

16 comments

  1. [16]
    teaearlgraycold
    Link
    Why use PHP as a freelancer? What advantages does the language offer to web devs?

    Why use PHP as a freelancer? What advantages does the language offer to web devs?

    4 votes
    1. [13]
      CunningFatalist
      Link Parent
      Strange question. If you're productive with a stack or language, it's fine to use it. As for PHP... It's a good, performant language with a stable ecosystem and good package management (PHP v7+)....

      Strange question. If you're productive with a stack or language, it's fine to use it. As for PHP...

      • It's a good, performant language with a stable ecosystem and good package management (PHP v7+).
      • It has Symfony and Laravel which are both amazing.
      • It has good tooling.
      • It's easy to deploy.
      • There are many PHP devs out there which makes handovers easy.
      • There are tons of PHP projects out there which makes it easy (or easier) to find work.

      Really, the only thing that speaks against PHP for web dev are very specific requirements. And if you have them, you probably know that.

      16 votes
      1. [8]
        unkz
        Link Parent
        I sort of agree that for a certain kind of web development, which is basically business card websites or blogs, there’s no big issue with PHP. It hits a capability ceiling very quickly though.

        I sort of agree that for a certain kind of web development, which is basically business card websites or blogs, there’s no big issue with PHP. It hits a capability ceiling very quickly though.

        4 votes
        1. [7]
          CunningFatalist
          Link Parent
          That's just not true.

          That's just not true.

          8 votes
          1. [6]
            unkz
            Link Parent
            I struggle to think how a PHP program is going to perform any kind of serious data processing. There's just no ecosystem for it.

            I struggle to think how a PHP program is going to perform any kind of serious data processing. There's just no ecosystem for it.

            2 votes
            1. [5]
              splorg
              Link Parent
              I built an app that handled multiple gigs in real time of Netflow processing in PHP. It's faster than many other languages that people commonly use for web development.

              I built an app that handled multiple gigs in real time of Netflow processing in PHP. It's faster than many other languages that people commonly use for web development.

              4 votes
              1. [4]
                unkz
                (edited )
                Link Parent
                Handled and did what with? Passed it off to something written in another language, or actually self contained in PHP? The actual handling is the big part, it’s easy to do throughput without...

                Handled and did what with? Passed it off to something written in another language, or actually self contained in PHP?

                The actual handling is the big part, it’s easy to do throughput without performing significant operations on data. PHP doesnt really have any powerful analytic libraries though, like sklearn etc.

                1. [2]
                  mattw2121
                  Link Parent
                  https://github.com/RubixML
                  2 votes
                  1. unkz
                    Link Parent
                    Obviously this is substantially less developed than equivalent Python libraries. It has some promise for the future though.

                    Obviously this is substantially less developed than equivalent Python libraries. It has some promise for the future though.

                2. splorg
                  Link Parent
                  Parsed and processed the entirety of the data, normalized it, and then wrote the resulting information into a time series database. This meant parsing every single line of data, aggregating...

                  Parsed and processed the entirety of the data, normalized it, and then wrote the resulting information into a time series database. This meant parsing every single line of data, aggregating together whatever was needed, grouped by time, source, and destination, and then bulk writing it as quickly as possible into the DB. It was a pretty serious process.

                  PHP is honestly very fast nowadays, and it has tons of third party libraries and tools (go browse packagist.org if you want to see a few.) Yes, there are way more specific math orientated libraries for something like Python, but I've yet to find something major I couldn't do in PHP.

                  FWIW, this Netflow app I reference was part of a larger SaaS application that currently serves hundreds of large companies that rely on it to run their businesses every day. I'm no longer part of the org, but I built the majority of the app in the early days, and I would do it in PHP again if I had to!

      2. [4]
        teaearlgraycold
        Link Parent
        Of course. What I'm curious to know is what scenarios it shines in - what it does better than the other major options. Things like: Ruby on Rails - If you want a full stack web framework that is...

        If you're productive with a stack or language, it's fine to use it.

        Of course.

        What I'm curious to know is what scenarios it shines in - what it does better than the other major options. Things like:

        • Ruby on Rails - If you want a full stack web framework that is as batteries-included as they come and has perhaps the best ORM in existence then this is your pick.
        • TypeScript - If you want the best type system available in a major dynamically-typed language and you're comfortable gluing together your own framework this is your pick.

        I understand PHP is a contender for being a good language in web dev. Things like "good tooling" and "stable ecosystem" are more-or-less table stakes there (although I admit you need to be careful when selecting your NPM packages).

        1. [2]
          post_below
          Link Parent
          I don't think there is any "this is your pick" language for the web. Sometimes a language is a nominally better choice for a particular project but generally any mature language is an ok choice....

          I don't think there is any "this is your pick" language for the web. Sometimes a language is a nominally better choice for a particular project but generally any mature language is an ok choice.

          That being said, PHP is the most widely used web language, so from a freelancer's perspective it's useful to be fluent in it.

          What scenarios does it shine in? Building web apps :) It's true that part of the reason for its popularity is that it's been around forever, but that's only a small part of it. It's really really good at what it does thanks to constant active development of the language over decades combined with a huge amount of community support.

          Bonus: It has better performance than other widely used web scripting languages, in some cases (Ruby on Rails) dramatically better.

          4 votes
          1. teaearlgraycold
            Link Parent
            Oh yeah, Ruby is too fancy for its own good. That makes it hard to optimize. It sounds like one of the main reasons to write PHP is because that’s where the work is. And it’s not terrible either...

            Oh yeah, Ruby is too fancy for its own good. That makes it hard to optimize.

            It sounds like one of the main reasons to write PHP is because that’s where the work is. And it’s not terrible either so there’s not too much reason to push clients away from it.

            1 vote
        2. CunningFatalist
          Link Parent
          I am sorry then. I did not interpret your post like this. Also, those are highly subjective points. I worked with the technologies you mentioned, and I pretty much prefer Symfony over Rails, which...

          I am sorry then. I did not interpret your post like this. Also, those are highly subjective points. I worked with the technologies you mentioned, and I pretty much prefer Symfony over Rails, which is also batteries included and ships with Doctrine - an amazing ORM - and TWIG - an equally amazing templating solution. I also disagree that TS is better than PHP. (For context: I like both TS and PHP, only worked very little with Ruby, and my favorite language is Go.)

          2 votes
    2. dsh
      Link Parent
      The language was literally made for web development. Plus hosting can get dirt-cheap especially if someone is still using something like cPanel. Especially as a freelancer - you may not want to...

      The language was literally made for web development. Plus hosting can get dirt-cheap especially if someone is still using something like cPanel. Especially as a freelancer - you may not want to build a custom CMS or Blog for a client so you'll opt for PHP services like WordPress, or Drupal.

      9 votes
    3. supported
      Link Parent
      I pump things out with PHP far faster than I could with any other language. Laravel is immaculate IMO.

      I pump things out with PHP far faster than I could with any other language.

      Laravel is immaculate IMO.

      2 votes