Live data from Hacker News

Taking PHP Seriously

slack.engineering

451–460 of 673 posts

Re: Taking PHP Seriously

#452

Earlier quoted context omitted.

Look at c++ as a counter example. Once immensely popular and yet I don't think many people would say it was well designed

It is still ridiculously popular. It has it's place close to the metal, but a bit easier to use than regular old C.

Yeah, I'm sorry but I dispute it is easier to use than plain C.

Re: Taking PHP Seriously

#453
Taking from the article..

> I claim that PHP’s simpler “think; edit; reload the page” cycle makes developers more productive.

Would you not use file watchers to reload the server? (especially in Node?)

Re: Taking PHP Seriously

#454
post #16

I work on PHP at my day job (in a public company), before this, I came from Ruby, and .NET before that. I'm convinced the reason so many successful projects use PHP, is not because of any inherent nature of the language. I think it's the people who use it. They just don't care. A successful project needs to be started by someone that cares just enough, but not too much. If you're programming in PHP, you're not runnin…

> I think it's the people who use it

> They just don't care.

> It's a garbage language.

I think this overly dismissive/elitist approach is part of the reason why alternatives failed. Couple that with the ridiculous claim that a developers' time does not matter.

Re: Taking PHP Seriously

#455
post #354

PHP is wonderful as a thin layer of glue between your database and the web browser. It's when you write a thick middle layer that PHP gets unwieldy. Business logic: Don't write it in PHP. Write it in PostgreSQL. Authentication: Don't write it in PHP. Use Apache 2.4's mod_auth_form. Replace hundreds of lines of PHP code with a few lines of Apache config. When it gets to your PHP script, all that's left to do is read $…

I always wanted to do PHP this way as I have a Perl background but since PHP5 appeared in 2005 the psuedo-Java posse took over and it was PHP Design Patterns everywhere and suddenly procedural/functional PHP was un-idiomatic. I find this odd as Java's verbosity can be forgiven as it gets compiled away. Not so PHP5's verbose OOP which has to be fed to the interpreter.

I wonder if procedural/functional PHP will make a comeback, since functional programming is kind of the shiny right now.

Re: Taking PHP Seriously

#456
post #221

Earlier quoted context omitted.

Rust and Haskell are both extremely well designed. Most of the "top languages" by percentage usage are 20+ years old, so I can't fault them that much for being badly designed, but we should definitely stop using them.

> we should definitely stop using them That will never happen, you can't write code like this in Rust: Customers Even when the previous code is an abomination, it is absolutely easy to write, this is why languages like PHP are a success, the barrier to entry is definitely low. The issue comes when the whole industry buys the idea that PHP equals bad code, fail to appreciate the progress the language has had in the la…

Why would I ever want to access the database from the presentation layer? That you cannot write that abomination in rust for me it is a clear advantage, not a disadvantage. And still I can't understand how can you compare php with rust. A much more apple to apple comparison would have been with WebSharper.

Re: Taking PHP Seriously

#457
The author incorrectly states PHP stands for "Personal Home Page". It changed in 1997 with the release of 3.0 when the project changed from being called "PHP/FI" to just "PHP", a recursive acronym - "PHP: Hypertext Preprocessor".

Re: Taking PHP Seriously

#458
My assumption is they already knew PHP before setting out on this (if not I'd be interested in hearing about that). What you know is a huge part of these decisions. I doubt many of the sites noted truly picked PHP after sitting down and doing a comparison of all the popular languages across the board. Their systems grew out of what they knew and there was no time to rewrite or maybe there wasn't a need either. If you like PHP and can support it good for you.

Regardless of their findings I wouldn't recommend anyone learn PHP if starting out.

Re: Taking PHP Seriously

#459
I was kind of surprised to read this and started to think this was just a copy of a previous speech I've heard before.

I was right it was: https://www.infoq.com/presentations/php-history but the author is the same person.

It is a good speech and I've been developing in php for years, written a blog post (http://sucky.ninja/leaving-php-is-too-expensive/) about it but I do no longer use php for my backends.

I've whole-heartedly switched to ASP.NET since my productivity is increased with it and I can actually use the language (C#) for other things. I would've agreed with the author a couple of years ago but with Azure, AWS and other cloud services it is simply no longer true that php gives developers a quicker feedback loop. I can setup a node server with gulp and start working in 10 minutes or I can start a new ASP.NET project and deploy to production right after the project creation has completed. With php I still have to setup a virtual machine etc etc.

I would not go back, even if it is cheaper.

Re: Taking PHP Seriously

#460

That example of "Surprise type conversions" is crazy. Did not know that. While i do not think PHP is a perfect programing language. There is one think i LOVE about PHP, it is that the PHP "community's" default way of documenting code behavior is to make a small example. When i read most other languages documentation i read it. Then i need to make a small test to verify that i understood it. All those tests takes a lo…

You will be happy learning Swift then. I love how Apple created it's documentation.
Post reply on HN