Hacker News new | ask | show | jobs
by theSIRius 2019 days ago
I really can't think of any green field project that would be started with PHP today. Maybe if there is some specification to use something PHP specific. But any use case I can think of, Python or node is a better choice. Maybe even Java. And Rust is on the rise now, in case speed is needed. PHP isn't dead yet. But it definitely is not growing.

Also arguing that choosing a language based on ugliness is a stupid idea is a stupid idea on itself. Quality of life during development is not an insignificant thing. The resulting project will suffer greatly if the chosen language makes me want to tear my hair out.

2 comments

I have started one side project , and one startup this last 3 month, all in php/symfony, though I have made extensive use of python (and php) in the past (and do a lot of rust on the side)

1. A mature ecosystem: Symfony is really really mature, all use case of a classic website are covered:

   * easy "admin" generation -> check

   * easy styling of your forms (a guy already made a 'tailwind' template, now I just do {{ form(my_form }}, and that's it

   * easy integration with webpack for my usecase with tailwind

   * pretty fast load to the point that the backoffice feels like a SPA (no flickering)

   * word-class ORM (Doctrine is just the best ORM ever, they really got right the 'if you know SQL, you will not have to learn yet an other dialect, all our functions/method use the exact same naming as in SQL , take that django ORM)

   * once again word-class ORM (Doctrine make it very easy to use all postgres-only, or mind you, mysql-only feature, DATE_TRUNC , json operators, full-text search operators  etc. etc.)

   * The documentation is not only encyclopedic , but also 'cookbook' (i.e you can either go A to Z, or they have dedicated article "how to have 2 database" , "How to implement a login through JSON" , which are much better and up to date than googling "how to X with framework Z"
2. PHP type system, sorry python but mypy just doesn't make it, I love my typechecking at runtime, how many times good willing developers in python have put `def myfunction(something: dict)` but it was actually not a dict, but a generator, and boom the next dev is mislead and introduce a bug

3. easy as hell to find developers, developers that likes to get things done and that are pragmatic (They know, I know, we all know PHP have shortcomings, do we joke about it? yes. Does it prevent us from moving forward ? no)

You have invested a lot of time into PHP and can make a living out of it. More power to you!

But from my anecdotal experience not many new developers invest the time to learn PHP. At the two universities I've been to, PHP is usually one and done thing. You take one course or just a few lessons with PHP in web development class and then move on to other things.

I also got the same kind of class, I think php was a 2 week class (less than the Java courses or SQL courses, same as the ASM courses).

a 2/3 of my career was python, I 2~3 years of PHP around 2011-2014, and now I'm using it back as I'm finally doing my own company.

And the best part of it ? It's right where I left it, even thought it went from 5.4 to 8 , and from symfony 2 to 5. It feels like leaving your old band from college to find out you all have the same habits, just everyone improved along the road.

Regardless how much I like python, to have been the one needing to own the "python2 to 3 migration" projects of 3 companies, it was not pretty.

My anecdotal experience is that in university, the only programming languages I learned where C, C++, and COBOL.

The rest was data structures, algorithms, etc. I've picked up many languages over the years and just applied CS concepts on them.

Market share of WordPress as website platform in 2011 : 13% In 2020 : 38% Yeah, php is not growing. Growing might start to become difficult when you en 40% of the web.
Which of these new websites have large userbase? Anyone can start their Wordpress blog with some limited free hosting and thus increase Wordpress market share. And since internet has grown considerably in the last 10 years more people tried to make their own website. And with Wordpress that is incredibly easy for people who are not technologically inclined.

Sure, websites like TechCrunch, BBC, Playstation Blog or Variety use it but they have done so for a long time. Newer websites/companies are not using Wordpress and maybe not even PHP. Medium runs on combination of Node and Go, Twitch has gone with Ruby on Rails among others, Trello runs on MongoDB and CoffeeScript on the frontend and I could go on.