Live data from Hacker News

25 Years of PHP

jetbrains.com

61–70 of 426 posts

Re: 25 Years of PHP

#62
post #39
post #17

Earlier quoted context omitted.

Ah yes, the classic "my application is shit so the language must be shit" straw man argument. Sorry to hear you have to work on shitty code. But neither the choice of language nor the lack of framework are to blame. Blame the developers and/or the organizational culture that caused it to be in such a poor state.

> But neither the choice of language nor the lack of framework are to blame. This is partly true. It is possible to make something great with substandard tools. I suspect a master craftsman with a set of dull saws and blunt chisels using his shoe for a hammer will still have the skill to create something pretty good. But it will be frustrating, and most people aren't master craftsmen so what they will produce will be…

you mean your favorite language prevents you to copy paste code, have variables shorter then 4 letters and also fixes the bugs for you, let me know this cool language so I can try it.

I am also sure that in your first years of coding your code had no issues similar with the ones you described.

Re: 25 Years of PHP

#63
Anonymous function and callbacks in PHP are a mess (Have you ever heard of Closure::fromCallable). Native function name and argument order are a mess with no clear convention. This thinks alone have made me abandon the language a couple of years ago. (I have two Zend PHP certifications and I was using PHP since v.3). Now I'm very very happy with fullstack Javascript (plus occasional TS help).

Re: 25 Years of PHP

#64

Recently I have been thinking about moving my personal blog from Wordpress to a static site generator, because I don't allow comments or use Wordpress plugins. (Those who want comments can still use a combination of a static site generator and Disqus.) It occurred to me that once I did that, I could completely disable PHP on my Apache installation. It made me wonder how much usage of PHP out there is essentially a hi…

Depend on how you count what is static site generator. Dreamweaver has a template system you can use to generate pages. It could probably be considered a WYSIWYG static site generator. I have never used FrontPage, but I would imagine similar system also exists. There are also a lot of other WYSIWYG website editors out there during late 1990s and early 2000's. Despite that, CMS system thrives.

On the "easier to use" front, there was also iWeb and apps like RapidWeaver.

Re: 25 Years of PHP

#65
post #41
post #20

I wish more digital subscription models were more like the jetbrains one. If you paid for one year continously they handle it like you own that specific phpstorm version, even if you cancel your subscription. That said, I wish I could subscribe without having a company ._.

What do you mean? They do offer licenses for individuals, and I've had a personal license for over seven years now.

He might be referring to the UX problem they have on the sales page where it is non-intuitive that you have to click a button to switch to the individual pricing. This affected me recently.

Re: 25 Years of PHP

#67

Earlier quoted context omitted.

The biggest advantages of PHP over Java are build and deploy times, so coding a php app is much more rapid. You can test your app right away, even after a single line change and get immediate feedback on the screen, which I think is important in web dev because a lot of it is visual. The other advantage is the run-time. Java has a slow startup time and when you redeploy then you need to stop/start your entire app. Wi…

> Another advantage is that php runs each request with a clean state, that means all the variables get destroyed after the request, helping to avoiding memory leaks, and possibly issues with concurrency which Java exposes Care to elaborate? How is that different than java web frameworks?

In a Java web framework, your classes have static fields, so user code or any library can assign values to them.

Language support for a request being ephemeral is far more effective than frameworks proposing it as a good practice.

And everyone working on PHP libraries in C know what a request is and that it ought to be ephemeral, so even outside the core language there's a clearer understanding.

Re: 25 Years of PHP

#68
post #6

PHP is damn fast now, no joke. And with all of the modern features it's actually not so bad to work in. I'm becoming increasingly puzzled every time I see PHP hate now, especially when I read tired comments like "just use rails". Laravel is arguably as good or even better than rails at this point, and PHP 7+ is definitely light years faster and lighter. One thing that still sucks is package management / composer.

> not so bad to work in

Yeah, if you know it well enough, maybe. It's horrible to work with as a newcomer or someone who only needs to touch it once in a while.

Re: 25 Years of PHP

#69
post #52
post #32

I wrote a lot of PHP from 1999-2008. First as a hobby, then professionally. From 20 LOC guestbooks to payment gateways used to process millions in payments. It wasn't until recently that I was sure I'd written more code in any other language than PHP. These days I'll occasionally poke around with it or patch a bug, but that's about it. Is it a perfect language? No. But which language is? (I can hear the Lisp crowd gr…

some of the function names make me want to stab people What would be an example? My only real gripe with PHP is the annotation syntax What do you mean? Afaik there is no "annotation syntax" in PHP. Could it be that you confuse what certain frameworks and IDEs do with PHP, the language?

> What would be an example?

The mix of c like strpos, strstr and inconsistent parameter ordering (see array map and filter for example)

> What do you mean? Afaik there is no "annotation syntax" in PHP. Could it be that you confuse what certain frameworks and IDEs do with PHP, the language

If there's no official standard, but everyone follows a community standard, then that is the standard. Quit being pedantic.

Hopefully PHP 8's attributes work to fix the mess that is phpdoc being used for annotations.

Re: 25 Years of PHP

#70
post #6

PHP is damn fast now, no joke. And with all of the modern features it's actually not so bad to work in. I'm becoming increasingly puzzled every time I see PHP hate now, especially when I read tired comments like "just use rails". Laravel is arguably as good or even better than rails at this point, and PHP 7+ is definitely light years faster and lighter. One thing that still sucks is package management / composer.

The speed is the main reason I decided to experiment with building a Node.js module last week that allows you to use PHP as a templating engine for Express apps: https://www.npmjs.com/package/php

I had guessed that PHP might be faster than mainstream JS-based templating systems like EJS and in my tests so far in an app I'm building it appears my guess was right. Even with the overhead of serializing and deserializing the data model from Node to PHP, on one of my more complex templates the PHP version outperforms the EJS version by around 10%.

Post reply on HN