Live data from Hacker News

We Don't Hate PHP

hologram.io

51–60 of 85 posts

Re: We Don't Hate PHP

#51

Earlier quoted context omitted.

The two best reasons are these: 1. The Laravel ecosystem. 2. I have over ten years of PHP experience.

Using PHP sounds like a perfectly sensible choice, given your circumstances. Your argument falls short of convincing that PHP is the best tool for _everyone_, though. 1. I'm not aware of any non-trivial feature in Laravel that isn't matched by e.g. Rails, Django, Elixir, or indeed any sufficiently modern web framework. 2. This speaks more to where your comfort zone resides than any intrinsic merit of the language/eco…

I'm also wondering about the initial point, but ...

Is there ever a best tool for _everyone_?

I have only ever been convinced that something is the best tool for a job, when taking into a account a lot of context, exact requirements, available resources, etc. Otherwise you are almost always left with quite a large number of options that are equal for the information available and you can basically choose from by rolling dice.

Regarding 2) I think it goes beyond comfort zone. I have seen plenty of completely chaotic, unmaintainable code bases due to the initial developer(s) starting the project without any prior experience of the technology. Of course many paths lead to chaos, but I would wary to start anything time critical in something too different to what I'm already quite comfortable in

Re: We Don't Hate PHP

#52

This is such a surface-level article. Most of the things listed as advantages exist in other languages as well. Here are some actual reasons to like PHP: 1. Java-like interfaces and classes and strict argument (and soon parameter) typing enforced at runtime 2. Autoloading and "lazy loading" of classes means defining bi-directional relationships between classes/types is painless (this can of course also make you shoot…

Hey, really good list, better than the article.

I don't really like PHP, because of inconsistency (it tends to break to flow for me) (but maybe it changed since 2014), but php with strict typing is a big plus for me and php7 is already more than fast enough. I might try it again.

The real issue i have with PHP is frameworks :/

Too much choice is a productivity killer for me.

Re: We Don't Hate PHP

#53

After reading the PDO section, I started to wonder if the author has used a language other than PHP. How can PHP have the best database integration if the best example you can show are simple prepared statements?

When I last worked with PHP, I used PDO because it mostly worked like Perl DBI. I agree that it beat using the old mysql interface in SQL-injection mode, but it was by no means a revelation. The Perl DBI has been around since the 1990s: O'Reilly's Programming the Perl DBI came out in 2000.

Re: We Don't Hate PHP

#54
The autoloader feature sounds interesting. I've always wondered why there is so much ceremony around importing modules when it seems like the compiler could figure it out in many cases (e.g. when you follow the Go-like style of having module names at the call site).

For example every Java file seems to start with entire screenfuls of imports.

I've never seen that in any other language. Though I'm sure there are a lot of pitfalls, because module systems tend to grow complex over time.

Re: We Don't Hate PHP

#55

PHP to me is a bit like the new Perl. Sometimes you just need a small script that does one thing well. Took me 10-15 minutes to implement an interface for customer support so they can look up a clients last order based on incoming phone number (via Aircall) or name and surname. FTP'd it to an already existing company server and it just works. And saves them weeks of time over a year probably. Nobody cares that I debu…

something about just getting the job done, i remember working at a place like that. i think we romanticize it a little bit though. we didn't have any version control, and deploys were literally paste the file on var/www and refresh. onboarding a new engineer, spend a month before they are actually productive.

i'm glad those times happened, they were fun - but i wouldn't want to work like that today.

Re: We Don't Hate PHP

#56

I don’t hate PHP either. I just want to be able to get another job doing something interesting after I spend 18 months at your company. Otherwise I’ll be stuck in the public sector maintaining broken Deloitte unemployment portals, making 1/3rd of what junior coding academy developers make. Easy calculus.

Blame the language for boredom. I think you'll like working at Microsoft. Because they frequently reboot apps, their OS, apis with completely different languages and ui paradigm for absolutely no reason - quite stimulating to the devs.

Re: We Don't Hate PHP

#57

Sorry guys,PHP is the outdated! (From someone who start PHP in 2000 with PHP 2.0 and is still reading lastest Laravel code source). To young people: choose your language wisely, you don't need to know PHP to be successful in Web dev

> From someone who start PHP in 2000 with PHP 2.0

That doesn't add up. There was no "PHP 2.0"; the language was still referred to as PHP/FI at that point. And PHP 3 was released in 1998 -- by 2000, I have a hard time believing you would have still been using PHP/FI, which was a much more limited tool.

Re: We Don't Hate PHP

#58

Earlier quoted context omitted.

What makes Laravel so good and why can't we clone to a framework in say Python?

Laravel benefits substantially, IMO, from a "benevolent dictatorship" contributor model that targets "is this easy to work with" over pretty much anything else. Taylor Otwell can be a controversial figure in the PHP world at times, but the results are difficult to argue with.

But wasn't this precisely the case with Python? Guido was also its Benevolent Dictator for Life, and Python also placed high value on ease of use, and that there should be only one obvious way of doing something (without being dogmatic).

Did Python stray from this? Occasionally yes. Did PHP with Laravel? I'm going to guess also yes.

Re: We Don't Hate PHP

#59
> PHP has the best database integration of any language I’ve used

Entity Framework in .NET is lightyears ahead of PDO.

I'm a fan of PHP but the DB connectivity is definitely not one of the strong points.

Re: We Don't Hate PHP

#60
post #36

Earlier quoted context omitted.

I mean, you generally want node to be stateless too. the DB should be your state.

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

Yes, 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.

Post reply on HN