Live data from Hacker News

PHP is worth learning and using

bulletproofphp.dev

231–240 of 468 posts

Re: PHP is worth learning and using

#231

I have used PHP for years. Like it. Have accomplished some nice things with it. Think it's evolved nicely in recent years. Feel it's a great tool for particular problems. Will continue to use it. Will always be open to alternatives. Will never understand why some people find that so offensive and will tell you that you mustn't use it or imply that you are ignorant or stupid for using it.

Here's a choose your own adventure for people new to the field. Pick something you want to build, then see which languages are the best suited. If you want to build several things, see which languages are the most recurring and versatile: - Web frontend: Javascript/TypeScript - Web backend: Javascript/TypeScript, Python - Performant backend (where you manage threads and queues): Go, Java, Rust - Machine learning: Pyt…

You can build almost anything with any language.

I've done shell scripts in PHP. Mobile development in Ruby, JS and haxe. Web development with Go. Nothing is stopping you, and if you know the language it is usually not to weird either.

Re: PHP is worth learning and using

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

Php has developed a lot in a decade. Lots of new good things in php7/php8. The typecasting is way better than before, but it still allows you to be more "dynamic" if you want to.

   $x = [1,null,'xxxx', collect([])];
gettype($x) is "array". you can annotate a type as being an `array`. How does that help me exactly?

Re: PHP is worth learning and using

#233
post #229

Earlier quoted context omitted.

Good jobs though? Lots of PHP jobs in Canada, but the salary is nearly universally always laughably low.

Same here in Switzerland. And other than working on actual modern PHP these jobs are usually maintaining old software with weird custom scripting languages like typoscript xsml ... I'd consider a PHP job, but only if they quarantee they don't have any of those legacy maintaining things lying around.

> I'd consider a PHP job, but only if they quarantee they don't have any of those legacy maintaining things lying around.

I see your point, but there is lots of legacy code (in any language) laying around and making shit tons of money for their owners - hence the need to maintain these systems.

Re: PHP is worth learning and using

#234
post #33

Earlier quoted context omitted.

There's nothing platform-specific about C# and Kotlin.

In theory, true. In practise, they are most popularly used for the Microsoft and Android ecosystems, respectively. I’ve reworded it to platform-oriented.

This is such an outdated view, Kotlin is taking on the server by storm and has first class integration with the biggest ecosystem in the world

Re: PHP is worth learning and using

#235
post #163

Most arguments against PHP miss the point. You know why you should use PHP? Because it's fun and you can get something running much quicker than figuring out the Elixir, Ruby, Rust, whatever ecosystem and paradigm. Maybe PHP is not so good at WebSockets or async worker threads, but most projects don't need that. There's no shame in doing long polling, users can't tell the difference anyway! PHP shines when you're try…

Until someone implements long polling in wordpress and has to load the whole framework for every poll. This can never be the right approach

Re: PHP is worth learning and using

#236

Earlier quoted context omitted.

I'm a PHP fan, but I think the following needs clarification > package manager to install dependencies (PHP apps are self-contained) PHP has Composer, which is one of the best things to happen to the ecosystem. Chances are, the piece of software you install will manage its dependencies in this way, and I'd be reluctant to install it if it didn't, as you wouldn't be able to update the software easily.

It does, but it's mostly transparent to the user. I've never had to think about it when I was installing WordPress.

When you start on a minimal server installation setting up LAMP to the point that wordpress doesn't complain is just as much work as setting up RVM/Node and Passenger to run whatever language you want.

Re: PHP is worth learning and using

#237
post #147

Earlier quoted context omitted.

> Hey presto, you have a functioning web shop, business website, charity home page, or whatever other thing you want. If we're talking about simple templates to open a store or a simple landing page there are so many no-code options like Wix/Shopify/SquareSpace/Square that I don't think PHP offers any significant advantage.

I believe at least one of the options you listed is actually built with PHP (Shopify).

[deleted]

Re: PHP is worth learning and using

#239
post #163

Most arguments against PHP miss the point. You know why you should use PHP? Because it's fun and you can get something running much quicker than figuring out the Elixir, Ruby, Rust, whatever ecosystem and paradigm. Maybe PHP is not so good at WebSockets or async worker threads, but most projects don't need that. There's no shame in doing long polling, users can't tell the difference anyway! PHP shines when you're try…

I used to believe this, but... But that's just not true. All the things you mentioned are a yum/apt/nix/pacman/ install away on Linux, and probably as simple to install on macOS. I'm sure Windows has installers for these, too. So, it's no harder to develop in them than it is in PHP. You could argue it's cheaper because you don't have to pay for a shared hosting provider to host your files. However that's a bit moot s…

> The ephemeral process nature of the language makes some tasks very difficult to do in a performant way (but there's caching, so that's at least mitigated).

I'd rather say that this is actually one of the biggest selling points for PHP. Opcache and JIT works great, and reduces the overhead, but ironically, PHP is great for serverless applications.

Re: PHP is worth learning and using

#240

Hey if you don't like PHP please don't use it. I 'd hate to bring the culture of tiny packages, fake compilers, transpilers and weekly trends to PHP. Personally I use php because it works well and fast and still supports my 10 year old websites, not because it's cool.

I would love not to use it, but I'm compelled to. It is not only my choice, but the choice of others who are not interested in new languages (assuming that Python is new language...) and prefer to use PHP because they don't know anything else.

So yes, let me express my antipathy toward the PHP language and its ecosystem.

I work not "well". It has hundred of issues that are not, and will never be addressed. Like the inconsistent choice of function names, the antic (if not prehistoric) way of extension managing, the clumsiness of xdebugger, the bugs in the PDO library, etc.

I spend 80% of the time trying to figure out "a hack", and spend too much time on php.net & stackoverflow hunting for the right answer.

Post reply on HN