Live data from Hacker News

25 Years of PHP

jetbrains.com

111–120 of 426 posts

Re: 25 Years of PHP

#112
post #103

Earlier quoted context omitted.

> Another advantage is that php runs each request with a clean state PHP apps are almost guaranteed to be "stateless", thus scaling up and down is quasi-painless also.

OTOH, sometime you need state, then you feel stuck with a half-finished language.

What are you using state for in a web app or API?

Re: 25 Years of PHP

#113
post #93

Earlier quoted context omitted.

Not if you code a lot. It is not rare for developer to use vertical screen. https://img.devrant.com/devrant/rant/r_200135_Q9Fh4.jpg

I mean I'd say it's pretty rare. I've only seen a handful of people do it personally, and I've never seen anyone exclusively use a portrait screen.

With modern monitors being as large as they are already, I'd say the need for a vertical monitor is likely an indication you're working with spaghetti code.

Re: 25 Years of PHP

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

While I agree that PHP does have pros as well as cons, I find it disconcerting that I've read MANY assertions here on HN, that PHP detractors just haven't used it very much or are mostly complaining about things like bad standard library function names.

I've used PHP in earnest. It and JavaScript are tied for worst programming languages I've used. JavaScript gets more of a "pass" from me because I'm just not a dynamic-typing fan and I'll admit that it might be less awful for someone who enjoys/prefers Python or Ruby or whatever.

PHP, on the other hand, is basically just worse-Java. And Java isn't a great language, either. The built-in PHP array is a constant source of frustration. Keys are sometimes strings, sometimes ints. And you don't always know which it is! This makes working with the array_* functions cumbersome at best. The fact that you can't typehint everywhere also sucks. No generics sucks. No threads sucks. No (real) async sucks. Globals suck (including different language behavior based on a config file on your machine...........).

It's just not a strong language. And I'm super-tired of hearing "it's not the tool, it's the user." There is such a thing as a shitty tool. And just because some human somewhere CAN write working code in Brainfuck, does NOT mean that anybody SHOULD. I'm similarly tired of "all languages have warts". Do I even need to actually explain the fallacy there?

On the other hand, I agree 100% that PHP's deployment story is awesome! But is that because PHP did anything useful, or because Apache and Nginx support PHP out of the box?

Re: 25 Years of PHP

#116
Most people don't know this and the timeline also doesn't make it very clear: PHP never started as a language but as a templating system for C.

Feature requests were quickly added and that's why PHP became a language with a lot of quirk's.

Today that is totally different. As a scripting language it is blazing fast. It still has some strange corners, but it's amazing that a templating system because such a wide used language.

Re: 25 Years of PHP

#117
post #52

Earlier quoted context omitted.

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

There's possibly an argument that reusing C names when you're wrapping or emulating C functions is actually a good usability design choice which has, over time, become a negative.

Like a floppy-disk save icon, what helped one generation becomes obscure to the next and they obly see the flaws.

Re: 25 Years of PHP

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

> It has a very rich standard library

Yet I still have to define startsWith() and endsWith() any time I touch PHP code...

(More importantly, PHP is the one language I can never write from memory without referencing the manual for each and every function call because of how inconsistent it is. Eg Sometimes $haystack is the first parameter and sometimes it is $needle.)

Re: 25 Years of PHP

#120

Earlier quoted context omitted.

What are the "modern" features of php? It looks like it's trying to shed it's dynamic nature and add types (with annotations etc). Also frameworks like Symfony / Laravel look more and more like java web frameworks to me. I'm not saying this is necessarily bad but there's nothing modern about types. Also, might make more sense to choose java if you need types.

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…

Recently did some nodejs work. It was surprisingly fun. There are A LOT of sharp edges, but working "closer to the metal" is great. Fast deploy and startup is GREAT.

Am an early, vocal Java partisan. Java world HTTP servers fell into a ditch and kept digging. Servlets and JSP weren't too bad. Wasn't crazy about Tomcat or NetSuite, but ok. Then it just got more and more nutty. J2EE, Spring, XML, schemas, annotations, etc.

There's nothing about Java that rules out simple and quick. For medical records stuff, I replaced a huge J2EE/BizTalk style backend with stupid simple process runner for stupid simple tasks. Think Windows OS Task Manager running AWS Lambdas.

In conclusion, I remain sad about the enterprisey detour Java took.

Post reply on HN