Live data from Hacker News

I still love PHP and JavaScript

the.scapegoat.dev

371–380 of 402 posts

Re: I still love PHP and JavaScript

#371
post #326

Earlier quoted context omitted.

I'm a PHP dev, I didn't take part in StackOverflow survey and ~15 senior PHP devs that I know personally didn't take part either. Judging on such a small sample, I'd be guessing that it's safe to assume that survey is missing crucial data from people who do get paid well. I'm 22 years in the business, 16 years working at the same place. At this point, there's various bonuses next to salary. After so many years, it's…

That's how sampling works, not everybody writing Java, Go, or whatever else is filling out surveys, either. I know I haven't. I haven't looked recently, are there a lot of remote positions for US employees writing PHP for $200k+ base plus bonuses? I'm not even talking about the crazy-high comp from FAANG companies here, just Principal developer roles paying more than $200k base, with bonuses as well. My anecdote and…

Our anecdotes don't make the data, of course. My point was that narrow thinking in terms of languages is inaccurate and cannot be relied upon when it comes to choices relating to career.

Choosing the IT field because of compensation alone and then relying on top charts to choose the tech is what yields low quality.

Ultimately, every dev with 2 decades of experience will know more than 1 language and learn that tribal language/framework wars aren't helping anyone.

Getting things done and being of use is what our profession is. When one becomes useful, then the real career starts.

Re: I still love PHP and JavaScript

#372
post #350

Earlier quoted context omitted.

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

Thanks for the comment! As a counterpoint, I used PHP5 when writing https://www.goldeneaglecoin.com/ and it was always Programming is about adding abstractions on top of underlying computational substrates. Ultimately our CPUs don't care if we run haskell or PHP, they just run machine instructions. I never found it too complicated to use useful abstractions in PHP. I usually prefer inheriting a subperforming cache-fr…

Great comment! You clearly are well-versed in the ecosystem much more than when my PHP5 self gave up. If I needed a PHP dev for a project, I'd hire you.

> Adding caching and opcache doesn't invalidate the stateless approach.

> Programming is about adding abstractions on top of underlying computational substrates. Ultimately our CPUs don't care if we run haskell or PHP, they just run machine instructions. I never found it too complicated to use useful abstractions in PHP.

I'll push back a little on these. TL;DR: it's a trade-off.

My point with Haskell is that the entire language itself is stateless, so if per-request statelessness ("shared nothing") in PHP is a virtue, then certainly total statelessness ("purity") in Haskell is even more of a virtue. The problem is that, despite having similar performance to PHP, Haskell is hard to write.

This is illustrated with caches: if a PHP program had a line something like `if ($cache.retrieve('foo') != null) { echo "Success!"; } else { echo "it's broken"; }`, then now global state matters again.

Haskell doesn't allow code of this form, but forces you to think harder about how to make it work using e.g. monads, and this can be frustrating. But if you can get Haskell to work, you can get caching nearly for free.

Re: I still love PHP and JavaScript

#373
post #363

Earlier quoted context omitted.

I don't know any language that this statement isn't true about unless either: (a) you're a true, deep expert who uses the language all day every day (b) the docs are so poor it's not even worth having them open

Go might be a contender save for a couple weird features. JS might be with a few ground rules and/or enough tooling. I’m also willing to grant implicitly that there are tradeoffs here. Languages with small standard libraries usually have big community libraries and vice/versa.

JS isn't directly comparable due to the very delineated nature of ECMA -vs- DOM/NodeJS APIs - ECMA is pretty easy to internalise but you'd be hard pressed to get by without MDN DOM or NodeJS core API docs open (unless as you say you're abstracting them with community libs as you say).

I've only used Go sparingly - I heavily relied on docs, but yeah it may have a shallow learning curve. It's certainly much saner than Python (which seems to be the other language used in my "space" for e.g. ad hoc ops tooling, etc.)

Re: I still love PHP and JavaScript

#374

Earlier quoted context omitted.

> I feel like PHP documentation is very undervalued PHP is documentation done right because of the comments, essentially "Stack Overflow" for PHP before stackoverflow.com was a thing. I've found an example of documentation done wrong recently with Microsoft .NET 6.0. Apparently, Microsoft has decided that code samples are no longer important

This can go both ways. I have seen some very dangerous code examples in the comment section of the PHP docs.

Usually followed by a comment that says don't do what the last comment said

Re: I still love PHP and JavaScript

#375

Earlier quoted context omitted.

> I feel like PHP documentation is very undervalued PHP is documentation done right because of the comments, essentially "Stack Overflow" for PHP before stackoverflow.com was a thing. I've found an example of documentation done wrong recently with Microsoft .NET 6.0. Apparently, Microsoft has decided that code samples are no longer important

> PHP is documentation done right because of the comments, essentially "Stack Overflow" for PHP before stackoverflow.com was a thing. It's funny really, for a programming language to rely on comments made by random people, instead of having those aspects covered in the documentation itself. Shows a bit of lack of care. It seems half-assed as many things in the ecosystem seem. What happens, if they ever lose that data…

Here's a sample of a user generated comment on array_map

Assuming they backup the website, how's it going to get lost?

https://www.php.net/manual/en/function.array-map.php#113886

Re: I still love PHP and JavaScript

#376
post #371

Earlier quoted context omitted.

That's how sampling works, not everybody writing Java, Go, or whatever else is filling out surveys, either. I know I haven't. I haven't looked recently, are there a lot of remote positions for US employees writing PHP for $200k+ base plus bonuses? I'm not even talking about the crazy-high comp from FAANG companies here, just Principal developer roles paying more than $200k base, with bonuses as well. My anecdote and…

Our anecdotes don't make the data, of course. My point was that narrow thinking in terms of languages is inaccurate and cannot be relied upon when it comes to choices relating to career. Choosing the IT field because of compensation alone and then relying on top charts to choose the tech is what yields low quality. Ultimately, every dev with 2 decades of experience will know more than 1 language and learn that tribal…

I agree with everything you said!

I didn't choose to leave PHP for comp alone, I was surprised at the dramatic shift on comp after the fact. I certainly don't think I've said anything that suggests tribal warfare. PHP can make for some amazing productivity, for sure! I think I last coded in PHP about ten years ago, maybe a bit longer, but it definitely has its place in the market.

I only note that you didn't answer my question, so I think I'm going to carry on with my assumption that there aren't a lot of PHP jobs in the US paying $200k+ base. Not that someone should choose a career path solely to pursue higher comp, of course.

Re: I still love PHP and JavaScript

#377
post #299

Earlier quoted context omitted.

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…

> JavaScript even its inventor said it's time to move on. I hadn't seen that quote, do you have a link?

Probably meant JSON instead of JavaScript

https://evrone.com/douglas-crockford-interview

Re: I still love PHP and JavaScript

#378
post #203

Earlier quoted context omitted.

That's a funny way of spelling job security

job security in software development isn't a problem especially since the pandemic started, if you're working on crappy code its because you're choosing to at this point

You know nothing about the choices I make and your condescending manner is rather insulting.

I've been a paid programmer for over 40 years. When some code has seriously gone off the rails I can help.

Re: I still love PHP and JavaScript

#379
post #154

Earlier quoted context omitted.

Hahaha I'm freelance (aka ronin) and so the job security is actually a bit spotty. :)

Ouch that is the worst. Called in to a great big mess. I hope by the time you get called in they realize they need to invest in some clean up time.

"They" have usually been very grateful to have the disaster mopped up.

Re: I still love PHP and JavaScript

#380

I'd like PHP more were it not for the army of amateur programmers hacking wordpress.

Not every Wordpress developer is an amateur. Often times, as a programmer, it's easier for me to change my environment, language, or learn their stack to be helpful to them than it is for the company to switch their stack because of my unwavering views on "right" languages.

True fact, but in my experience there is some really shoddy wordpress code in the wild.
Post reply on HN