3 ms·
One advantage of PHP over Node or Java is that it is stateless, so no worrying about memory leaks. And most disadvantages of this disappear when scaling out.
by sroussey 6y ago
One advantage of PHP over Node or Java is that it is stateless, so no worrying about memory leaks. And most disadvantages of this disappear when scaling out.
- virtue3 6y agoI mean, you generally want node to be stateless too. the DB should be your state.
- throwanem 6y ago"Stateless" here meaning that a given process only lives as long as it takes to receive and respond to a single request, as in the classic CGI model (where PHP originated), or like how an AWS Lambda works. In practice it mainly means that, in exchange for process startup overhead added to your response times, you get to get away with being sloppy about how you initialize and dispose of resources. It's not something I have ever really regarded as a virtue, and it's one reason why PHP devs can have real trouble transitioning to platforms where the same assumption no longer holds.
- sroussey 6y agoYes, transitioning elsewhere can be an issue for sure! But dealing with small leaks that build over time can be a time sink to track down, particularly if in libs you didn’t author.