Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

391–400 of 468 posts

Re: PHP is worth learning and using

#391

Earlier quoted context omitted.

That is probably false for all practical values of "used".

Elaborate? Every language can be used, I stand by that statement. Sure they have very differing levels of easiness to start with but all are usable regardless.

Here's what you originally wrote:

> All languages can be used by everyone.

Now consider brainf#ck.

You see? For all practical values of used not every language can be used by everyone.

This is of course an extreme outlier (but absolutely not the worst I think) but there is a spectrum, or rather field of possibilities.

PHP is trivially simple to get started with. A teenager can manage to do it alone.

Re: PHP is worth learning and using

#392

Earlier quoted context omitted.

I have seen people deploy php this way but I'm not aware of anyone who'd do it today. Locally however it is save, alt-tab, ctrl-r and immediately you see the result. Absolutely no waiting. These days I rather use Quarkus for this but until Quarkus arrived this was a huge advantage that PHP had over every other language and framework I was aware of. Also the documentation was fantastic compared to most of the stuff I…

I deploy with a git pull Which I suppose is just a fancy way of a copying files to the server.

It is kind of just a fancy way to copy but at the same time gives you versioned deployments, rollbacks etc.

Re: PHP is worth learning and using

#393
post #322

Earlier quoted context omitted.

Forgive me for going a little off topic here but is it really true that JS was async-friendly from day 1? When I started using JS seriously 8 years ago, async code was horrible (callback hell, etc.) The web standards guys retrofitted native async way after the matter.

Doesn‘t this more or less mean "the only execution environment is event based, has a run loop outside of your control and calls your code whenever it wants" and "there is no busy sleep". So it was callback based from day one. Is that the same as async? I think it is?

That makes sense, thanks! It has indeed been run in a loop from the start despite the poor ergonomics - I did not think of it in that light.

Re: PHP is worth learning and using

#394
post #94

Earlier quoted context omitted.

PHP was my gateway to understanding C. It wasn't my first, but it definitely helped me learn more computer fundamentals than other languages.

PHP was my gateway to _everything_, most importantly employment. I don't use it any more, but in 2002 when shared hosting and deploying by uploading files via FTP was the thing it was a lot easier to get started with than Perl or Java (which I desperately tried to get into back then).

Oh yeah. PHP was the first language where I thought "hey, this thing that already works, I could rewrite it in exactly the same form in another language". I rewrote a Perl payment gateway thing that I had written almost alone earlier into PHP, made it OO and everything. No point whatsoever but what an exercise :P This was ~1997.

So it was almost the first language I used to make actual money.

Re: PHP is worth learning and using

#395
post #84

Earlier quoted context omitted.

PHP is used far more than Ruby. Wordpress alone dwarfes any Ruby usage.

I guess it depends how you quantify it, but I was thinking Shopify's use of Rails would have started competing for %

That's a fair point, I implied individual websites instead of % of traffic on the internet. I interpreted this thread mostly to be about number of jobs, in which case I think the number of websites is more important than the percentage of traffic, but I should have been explicit about it.

Re: PHP is worth learning and using

#396

Folks bashing PHP like it's crap but praising any crappy thing if it's built with an esoteric lisp-based language. I mean, if you're starting out, chances are you're better off with js/py or even go but in the end you're paid for the types of problems you solve, not by the language you use... It just turns out that some problems are easier in this or that language, or even people who are good at solving this or that…

R is another language that it is bashed constantly, but it is generally much productive in its field (EDA and stats on structured data) than the alternatives like Python.

Absolutely agreed! You can feel that R was made for its specific use case. Exploration, visualization, experimentation and modeling just __click__ for me in R in a way Python can never inspire.

In the Python ML world only the matrix libraries - numpy and similar APIs like torch.tensor and jax feel natural and click in my brain. The rest - data frame, visualization, scientific libraries; I'm not very sure how to explain it, but it always feels like some context switch is needed between using Python the language, and calling out to these libraries.

Re: PHP is worth learning and using

#397
post #43

Earlier quoted context omitted.

I haven’t used PHP in over a decade. I can never forgot how much PHP got wrong in terms of how application development on the internet would happen. The ergonomics of using it were just… bad compared to other frameworks that came on the market. I remember when rails came out and it was so mind blowing compared to PHP. The language was certainly useful for a time, and I’m sure the language has progressed since, but sw…

I'd be interested to know what you think PHP got wrong with respect to web development? The majority of the web is running on PHP to this day, so at least in terms of popularity it seems people don't feel this way generally. Furthermore, if one were philosophically-minded, it could be argued that PHP's "shared nothing/one thread per page" execution model is the very quintessence of HTTP.

I’m curious what metric you’re using to determine that a majority of the web is running on PHP.

Re: PHP is worth learning and using

#398

Earlier quoted context omitted.

I don't agree with Symfony being inherently "very heavy". As set of framework components, you can any part you find useful, and wire to together yourself, if necessary. e.g. https://symfony.com/doc/current/configuration/micro_kernel_t... Many other PHP projects, such as Laravel and Drupal pick-and-choose Symfony framework components in this way.

Sorry, I should have clarified "heavy" in terms of the level of OOP [1] insanity but yeah Symfony is very modular. [1] e.g. "Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator"

> in terms of the level of OOP [1] insanity

I would have to question how relevant a piece of core plumbing is to a regular user of the framework, as a regular user of the framework would likely never come across this class.

Also if you're working in the domain as a Symfony core developer, the idea of a ContainerConfigurator is not so insane, if you're developing a dependency injection container.

Re: PHP is worth learning and using

#399
post #61

Earlier quoted context omitted.

For people of a certain age and job history, the worst code they've ever inherited was written in PHP. I think JS can be worse. There are things that are possible with dynamic languages that are literally impossible with static ones. So think of PHP less as a "bad language" and more of a code smell.

I don't think any JS code can be worse than old PHP code. I've had to deal with legacy software written with PHP4. I was to port it to PHP7 since it was not compatible with PHP5.4+. The code used "register globals", meaning that variables were created on the fly from the parameters in the URL, the POST form data, and the cookies. Requesting `index.php?something=X` implied `$something = "X";` in the global scope at th…

As far as I know, you can't monkey-patch anything in PHP, but you can in JS[1]. That alone might make JS the more dangerous of the two languages.

1. https://www.audero.it/blog/2016/12/05/monkey-patching-javasc...

Post reply on HN