Live data from Hacker News

An Internet of PHP

timotijhof.net

231–240 of 333 posts

Re: An Internet of PHP

#231

Earlier quoted context omitted.

As a PHP developer of 10+ years, large frameworks like Laravel and Symfony still bewilder me. I really have no idea why 99% of people would ever want to use them. They add a layer of complexity over the top of PHP such that instead of learning how to write PHP, you need to learn how to write the framework. Let's take an example right from Laravel's homepage: Authenticating users is as simple as adding an authenticati…

> They add a layer of complexity over the top of PHP such that instead of learning how to write PHP, you need to learn how to write the framework. To be fair, you could say this about many frameworks in many languages; Ruby on Rails is the first obvious example of this.

These are more exceptions than rules. Rails, Laravel, and Django are the three massive frameworks that are languages themselves, so learning them as an introduction to their programming languages can be confusing for newcomers.

It seems, to me, that small server frameworks with middleware are what's in vogue right now. Flask, Express, Slim. C# added minimal API recently.

Re: An Internet of PHP

#232
post #33

"PHP is dead" is dead. The amount of people praising PHP these days is quite high and increasing. Of course I may also be in a bubble (of php devs), but I have seen a constant increase from JS-people starting to look (and in some cases, convert to) php. Also, many new youtube videos highlighting the new stuff in the language, how modern it is, etc. Honestly, anyone that blindly criticizes or dismisses php these days,…

It’s like meeting someone in 2023 who hates Micro$oft WinBLOWZ. Have they been stuck in stasis for 20 years? What other values from the 9/11 era do they hang on to?

Windows was getting better until MS started preventing users from deleting files, even if they are the owner of the computer. Yes, it is a foot gun, but it also makes fixing problems difficult and sometimes even impossible. Windows 11 seemed pretty nice until my son had a problem installing a game and one of those "untouchable files" was the wrong version, so every 10 minutes or so you'd get an error message. We fixed it by re-imaging it with Debian and Steam.

> What other values from the 9/11 era do they hang on to?

I'm still into taking care of my family, being honest with people, being nice to people, even if they are not nice to me, and I still like a good single malt whisky.

Re: An Internet of PHP

#234

Earlier quoted context omitted.

> Not to nitpick but choosing a programming language isn't a minor decision In the grand scheme of things, talking solely about software projects not life in general, it kind of is. Most modern languages, are interchangeable, and projects of most kinds have been done with all of them succesfully. As long as the programmers for the chosen language are available, and the libs you want are there, for startups doing some…

I disagree. There will be lots of considerations like ecosystems, long term support, ease to find developers, prior experience, etc…

Probably missed the "As long as the programmers for the chosen language are available, and the libs you want are there" part.

Re: An Internet of PHP

#235

Things I really like about PHP: Once the file is on the filesystem, it's deployed. Each invocation to run PHP is stateless and it parallelises effectively. (There's no communication, synchronization between PHP instances.)

It is definitely refreshing to simply upload a file via FTP and it updates your server. But it's this interpreted nature that makes PHP one of the slower languages in terms of throughout. I know, don't prematurely optimize, but there's a reason other languages don't do it this way

Re: An Internet of PHP

#236
post #179

Earlier quoted context omitted.

PHP dev since 5.0 here. I think the severity of these breaking changes is overstated. I’ve been able to keep several large business-critical projects up-to-date for years, even up to PHP 8.3, with little to no breaking changes encountered. PHP 8 didn’t really break adding properties to objects dynamically, it just deprecated one bad-practice way of doing so. I remember worrying about this before upgrading, across my…

I think you missed my main point: That people are different. I have not doubted that there are people who like the more rigid structure which the current maintainers push for. I actually mentioned that. But the success of PHP comes from the people who like PHP the way it was. Empowering them to write their own web projects with the least amount of code and bloat.

> But the success of PHP comes from the people who like PHP the way it was

I'm sure that was the case for many years, but I believe the successful resurgence of modern PHP is coming from the people who want to see PHP actively improving. Not those who like PHP the way it was!

PHP got a nasty reputation thanks to things like the "Fractal of Bad Design" site. Modern PHP has resolved (effectively) all of those early critiques.

The ongoing success of PHP comes from it continually improving :)

Re: An Internet of PHP

#237
post #71

Earlier quoted context omitted.

PHP has had a built-in web server since version 5. People use Apache or nginx because they want to, but because they need to.

I think using the php built-in webserver is not an option for a production setting.

Correct. From the documentation:

Warning: This web server is designed to aid application development. It may also be useful for testing purposes or for application demonstrations that are run in controlled environments. It is not intended to be a full-featured web server. It should not be used on a public network.

Re: An Internet of PHP

#238

Earlier quoted context omitted.

Well it's not exactly secure by default. I was deploying an app to a new server and some bot grabbed my .env file before I finished the Apache config. Ultimately it's my own stupidity, but you don't have to worry about that with most other languages

You shouldn't deploy .env files to production. You should set the actual environment variables on production. .env files are intended for convenience on non-prod systems.

Agreed, but server frameworks shouldn't easily enable a foot gun that allows bots to have disk access to your host. Instead, only explicitly defined routes or resource files should be available.

If I had to guess, this person committed their .env file in some repo and pushed that up, and that become available because the server was misconfigured.

For other servers (such as, say, Jetty), config files like that won't get exposed like that unless you're very obviously placing your config files in a public resource folder.

Re: An Internet of PHP

#239

php runs securely in 5minutes in any web server 3-10$/month. Every other tech, it's complicated servers or complicated billing, not to mention depencies and build tools. thats why php

Doesn't cPanel supported several langauge including NodeJS runtime? I think most projects use composer or PHP packages.

Thanks to cPanel (written in Perl) this make life easier for developers to set up websites and skipped the ceremony but why is cPanel written in Perl instead of PHP?

But Go language has it own security implementations which are more secure and easier to deploy as a static binary. I did tried to write entire Go app using only built-in or some dev use Chi for routing. I didn't have to install Go runtime on VPS that you need for PHP.

Go built-in HTML template is quite secure, rare seen some fix to html/template make it easier to deploy new app, but our website has evolved with Astro web framework that require NodeJS since none of the server side language can solve client-side issues.

Re: An Internet of PHP

#240
Related: I recently discovered the "fanlisting scene". In the early 2000s, some people started a trend of creating fan sites (a.k.a. shrines) for characters in TV shows, anime, games, etc. These sites ran on simple PHP codebases, such as Enthusiast, PHPFanBase, and BellaBuffs. Someone interviewed one of the developers here: https://hey.georgie.nu/hg-jem/ (For some reason fanlistings tended to use .nu domains, because it was cool I guess).

Most of these fanlistings (and also the massive number of forums running on vbulletin and phpbb in the early 2000s) were created not by software developers, but people who had a passion. It was a road that a lot of people, especially girls, took to get into software development. I think that gender parity in software development might have hit a record high during that time.

Post reply on HN