Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

301–310 of 402 posts

Re: I still love PHP and JavaScript

#301

> They are used by people who get shit done. pretty much says it all. let me finish building this shitty app by deadline, while you guys continue argue about which static type checking system is better.

And then run off for the next job after a year or two and leave the rest of the dev team with your badly written code, so that they have to clean up the mess behind you?

always give the dev the benefit of the doubt and assume they were working under difficult circumstance with jackass stakeholders/pm's.

Re: I still love PHP and JavaScript

#302
post #4

PHP 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 has so many hidden benefits: > - it's stateless by design (much easier to scale) I'll grant you this one. Though PHP in practice goes to great lengths to add state back in for performance reasons (e.g. memcached, or for a while APC). And Haskell is stateless, too, yet not a frequent choice for web work. > - it was "serverless" before Serverless This is retconning. It was never trivial to set up a LAMP stack, es…

> That is a ton of wasted work, and there are literally sections in the PHP docs about tools to circumvent this problem.[0]

Install opcache, done. No need for hyperbole.

Re: I still love PHP and JavaScript

#303
post #81

Earlier quoted context omitted.

Not sure about "no surprises" - just saw this on Twitter yesterday: https://twitter.com/LupinityLabs/status/1554217944179249153

This is hardly specific to PHP. You should never compare IEEE floats using equality.

It is absolutely the fault of PHP. You absolutely can compare IEEE floats using equality. Often it isn't what you want but this totally should work.

In this case PHP is unexpectedly rounding floats for display.

    ~ python3
    Python 3.9.13 (main, May 24 2022, 21:28:44)
    [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>> b = 46333.48000000001
    >>> b
    46333.48000000001
    ~ php -a
    Interactive shell

    php > $b = 46333.48000000001;
    php > echo $b;
    46333.48

Re: I still love PHP and JavaScript

#304
post #4

PHP 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…

DISCLAIMER: I am not actually a "backend" developer (although I have written some pretty big backends).

I am not a JS fan. This is not because I have anything against the language; it's just that I have no real need for it, and have treated it as a "necessary evil," in my frontend work, so I don't believe that I have much of a platform to lob spitballs at it.

PHP, on the other hand, is a language that I have used for over 20 years. I think it was 3 or 4, when I started. If I do backend work, these days, I'll be doing so, in PHP.

I always like looking at the "fishtank graph"[0]. That sort of puts things in perspective.

[0] https://w3techs.com/technologies/history_overview/programmin...

Re: I still love PHP and JavaScript

#305
post #245

Earlier quoted context omitted.

I've used Python, C#, Java, JavaScript and PHP, and in my experience Python is the most unpredictable of these languages. Just to name a few: - mutable default arguments - late binding closures - typings that are purely documentation instead of being enforced Labeling these things as "gotchas" doesn't make them predictable imo.

Python less predictable than PHP? In what world? In PHP standard library functions silently take a null instead of a string, even though they are string handling functions, hiding that mistake for the user of the language, until a later point in time, when the context has been lost and one needs to do silly debugging, until one finds the place where the null first was handled, while it should have raised an error. Su…

> silently take a null instead of a string

Oh, so you _haven't_ used any of the recent versions of PHP, then. You're just talking shit with no actual recent experience. Gotcha. Well, thanks for your input.

Re: I still love PHP and JavaScript

#306

Earlier quoted context omitted.

They do. It's just that everyone seems to have collectively decided that cgi shouldn't be used anymore.

CGI has become "serverless" and it's hyped up to no end. The more things change, the more they stay the same.

use CGI; use strict;

Re: I still love PHP and JavaScript

#307

Earlier quoted context omitted.

Its so easy to just get things done in php, even if its in an ugly way that you would never show to another developer. I built a saas for a fortune 1000 company after not programming for 5 years and never having done web development that ran several processes for them and they used it for a decade. It was the ugliest code in existence but it was so easy to just update and after it was up it just ran, forever. Deployi…

> Deploying changes was just dragging over a file in Filezilla. Been thinking of building something new and considering learning node but PHP is right there. When I had to migrate to a new server I just copy - pasted the folders and away it went. These days most organizations will not tolerate just copying files over. There will be a process for testing the code and then stuff will probably be put in a container, to…

Not to meniton Kubernetes, AWS and Terraform. I don't think you really get PHP.

Re: I still love PHP and JavaScript

#308
post #208

Earlier quoted context omitted.

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.

Go is more difficult to deploy than php? php.ini files and php extension installations to get to production is what I remember

No, I was thinking 'less mature web libraries' for Go. It's hard to talk about groups of languages in broad strokes when there are various tradeoffs and each language has its own strengths and weaknesses, and I painted two possible weaknesses broadly across several languages that don't strictly apply to all of them.

Re: I still love PHP and JavaScript

#309
post #4

PHP 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…

Have you tried a more "modern" language recently? By trying I mean using it for more than 6-10 months. I've been one of the PHP "supporters" until I've found Go and Rust. PHP was really nice to get into programming and make a spaghetti website but the language itself and the ecosystem always felt like a hacking project. The killer feature of PHP has always been the hosting ecosystem. A simple FTP upload would do the…

> PHP was really nice to get into programming and make a spaghetti website

Facebook manages quite well with PHP. Maybe it's your fault you didn't learn how to use modern PHP practices which have been well-documented for over a decade now.

Re: I still love PHP and JavaScript

#310
post #158

Earlier quoted context omitted.

Do PHP applications really require no system packages for any use-cases?

PHP is pretty batteries-included, sometimes to a fault (it comes with things like 3 different MySQL drivers in the standard library). I'm sure there are cases where you'd want to install a C extension that depended on some system library, but I can't actually think of any right now.

imagick for imagemagick is a common one. but yeah, you can go really far with just relying on php standard features
Post reply on HN