I still love PHP and JavaScript
251–260 of 402 posts
Re: I still love PHP and JavaScript
#252Biggest flaw of php to me is getting paid well and the number of jobs. From the stack overflow dev survey, php devs get paid much less than others. Laravel and php is a beast, super easy to use. All that annoying shit is setup for you. But, how many ppl hire Laravel devs? Job boards are stacked with react, vue etc. Personal use is great though.
Community sentiment means almost as much as technical facts. PHP might be just as capable as Ruby, but the vast majority of devs, especially experienced ones, do not like it, will not suggest it, and will not apply for companies which use it. So all that’s left is low end wordpress jobs.
That's a bit of a reach, I would work for a company like Slack or Wikipedia of course even though they use PHP and so would many other devs. In fact the further I am into my career the less the tech stack matters to me; I've come to realize the bosses and the company's culture and leadership and how they generally treat employees is WAAYYY more important than whether the stack is Rails or Node or PHP. To me. They are all web stacks that do more or less the exact same thing and the work you do is really quite similar on all of them.
I was sure being a Rubyist is what makes me happy because I like Ruby...well guess what, you can be miserable in a Ruby shop...that's the lesson I've learned.
If I ever become super choosy about tech it's only because I really wanna switch directions - e.g do low level development or something like that which is dominated by C. But all the high level web languages ...are all the same to me (my preferences aside).
Re: I still love PHP and JavaScript
#253PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…
This is perhaps one of the better things about it! It feels like lots of different languages and frameworks would benefit from comments at the bottom of the page, from the community, explaining various common use cases and gotchas.
Somehow it feels like docs being on GitHub with people being able to contribute to them there somehow can have higher friction, versus a forum-like system.
Re: I still love PHP and JavaScript
#254PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…
> it's stateless by design (much easier to scale) I noticed being stateless made it difficult to scale for any complex app. It’s been 7-10 years since I used it but Drupal used 60-128MB+ plus per request. As it was stateless it had to do a full bootstrap for every request coming in, set up a new database connection, module discovery etc, all which was heavy to do for every request. Most people scaled Drupal by puttin…
Re: I still love PHP and JavaScript
#255Earlier quoted context omitted.
Python and Ruby have more startup overhead than Perl and PHP, so usually you don't want to pay that cost for every request. Edit: Not sure why this is controversial. Here is a "hello world" benchmark I just ran on my machine, in units of hello worlds per second: Perl – 1020 runs/second; Python – 78 runs/second; Ruby – 30 runs/second.
Can we have the "soft reload" model like how Django works in development mode? Drop a file on a server, it notices filesystem change, reloads an app (or spawns a second copy of app, waits for it to initialize, kills original app and switches over to a new one)?
One problem with this approach is what happens when you're updating multiple files. If the server restarts immediately on the first change, you end up loading a mix of old and new files, which probably won't work properly. But if you delay the restart to wait for all the files, how long do you wait? If the delay is too long it's confusing and annoying (did the server restart yet?) and if it's too short you get mixed versions as before.
So it's better to explicitly signal when it's time to restart. You can still have automatic restarts in the development environment.
[1] https://docs.gunicorn.org/en/stable/settings.html#reload
Re: I still love PHP and JavaScript
#256PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…
PHP documentation is one of the worst things I've ever seen. That people subject themselves to abuse such as "reading it" is comical to me. Enjoy scrolling down 15 years of comments to get the quick rundown.
I agree that the comments should be removed or at least hidden by default as they're usually not relevant anymore.
Re: I still love PHP and JavaScript
#257PHP has so many hidden benefits: - it's stateless by design (much easier to scale) - it was "serverless" before Serverless - surprisingly performant - no "unknown unknowns". it's so tried-and-true, there's no surprises - deployment is so simple, just drop a file on a web server. No middleware needed. - No long compile times because there is no compiling needed. EDIT: why the downvotes? If you don't agree, just reply…
Not sure about "no surprises" - just saw this on Twitter yesterday: https://twitter.com/LupinityLabs/status/1554217944179249153
According to the Twitter thread:
> First value was retrieved from a db, second was calculated, which has introduced rounding errors.
Re: I still love PHP and JavaScript
#258Earlier quoted context omitted.
That’s just it. I have to code with the PHP docs open like some kind of arcane recipe book.
Maybe it’s the frequency that you use the language? I go maybe 5-10k loc between needing to lookup anything in the docs at all, and 5-10x that where the issue I need guidance on isn’t in the formal doc. Much more frequently I’m looking up something related to the tools and libraries I’m using. The only surprising thing I’ve learned about PHP at the language level in the last 6-10 months is that you can call array_fil…
Re: I still love PHP and JavaScript
#259Earlier quoted context omitted.
I’ve been using PHP since 2003 and it’s my full time job and this doesn’t ring true. Very, very rarely is a gotcha not in the docs comment section.
i always found those comment sections to be so odd — fifteen year old comments about a common pitfall and the information never makes it up to the official documentation? i suppose it's fitting for a web-centric language to crowd source its docs on a website, but does any other mainstream language do this?
Re: I still love PHP and JavaScript
#260Earlier quoted context omitted.
But genuine question -- what other languages are as simultaneously as useful AND predictable?
Ruby, Python, C#, Java, and JavaScript are all are more predictable and just as useful. Go, Elixir, Clojure, and probably others are more predictable while being less "useful" only in the sense that they may have less convenient deployments or less mature web libraries.