zlacker

[return to "PHP 8.2"]
1. user39+j7[view] [source] 2022-12-08 13:16:18
>>TimWol+(OP)
The worst part about PHP is constantly hearing from its detractors, who are often people who haven’t used the language in many years. Haystack needle order, $, fractal of bad design, it just gets old.

The language isn’t perfect but I love working with it, these 8.1 and 8.2 improvements have really made it sweet.

My biggest gripe at the moment is the (very old) behavior of e.g. preg_match() and sort(). You’ve got a small handful of these common functions that operate on their input by reference/in place which is gross. A new version of these would be welcome.

◧◩
2. osrec+Xc[view] [source] 2022-12-08 13:57:39
>>user39+j7
The truth is, no language is perfect.

PHP just happens to be good at getting stuff done fast, so it's found all over the place, and thus has a lot of eyeballs on it. The negativity is a byproduct of it's usefulness and staying power - the price of popularity, if you will.

I love PHP, especially with the new event loop based modules that let you do things asynchronously, much like Node or Go.

If you know how to use it well, PHP is awesome, and it's getting better with each release.

◧◩◪
3. PaulHo+Qd[view] [source] 2022-12-08 14:04:01
>>osrec+Xc
PHP was the first open source language in which just anybody could write server-side web applications without terrible management problems for the sysadmin. First people wrote cgi-bin scripts in Perl, which were not efficient because they forked a process for each request. There was mod-perl which was more efficient but prone to memory leaks. A few people wrote cgi (or fast-cgi or Apache module) programs in C/C++ but that was insane since a return after a 𝚜𝚝𝚛𝚌𝚙𝚢 is Turing complete in C and there weren't any mitigations for this in the 1990s.

PHP opened the door to cheap web dynamic web hosting and in turn you had self-hosted applications like Wordpress. It was a few years later that languages like Java and C# became really attractive for back end work, you also had Ruby, Node, etc.

I wrote a lot of PHP in the early 2000s because that is were the work was, that’s what you could write open source code that people would use in, and it was really straightforward to build apps (like a social network for a secret society) without an ‘ops’ team watching your every move.

◧◩◪◨
4. davesl+ZB[view] [source] 2022-12-08 16:08:38
>>PaulHo+Qd
This is a refreshingly nice, informed, and balanced perspective.

I've only done PHP for small personal projects and some wordpress hacking, and that was years - so my experience is limited. But it seems to me that one of the great and tragic things to PHP is the low barrier to entry. As you put it: "first open source language in which just anybody could write server-side web applications without terrible management problems for the sysadmin".

This made it extremely easy for anyone in the early 2000s who signed up for a web hosting account on godaddy/hostmonster/hostgater/etc... to fire up a text editor of their choice and start slinging code and FTP'ing up to a server. Didn't have to worry about installing, configuring, all the dependencies, build tools, etc... just edit, upload, refresh -- lather, rinse, repeat until it works. Lowered the barrier to entry, and got a lot of people into the field. Really powerful stuff.

It also made sloppy, hacked-together, copy-pasta code very prevalent. In my limited perspective, I suspect that this prevalence of sloppy spaghetti-code has contributed to PHP's bad reputation. It's not that you can't do good code (totally can!), but a PHP environment can be forgiving of some pretty bad practices.

◧◩◪◨⬒
5. osrec+ZI[view] [source] 2022-12-08 16:37:11
>>davesl+ZB
The thing is, I've seen sloppy, hacked-together code in finance, in a variety of languages, including Java and C, where the barrier to entry is relatively high, and the language fairly strict. You just don't hear about the coding fiascos, as they're mostly behind closed doors.

PHP has a low barrier to entry, but that's a great thing in my opinion. It's something that should be celebrated, and at the very least, it shouldn't be a criticism!

Bad developers exist in every language, and no language is completely wart-free. People just like to zero in on PHP to criticise it because it's easy, and it bugs me a bit (especially if they're simultaneously singing the praises of another less than perfect language such as JS or Python or Go).

◧◩◪◨⬒⬓
6. PaulHo+HL[view] [source] 2022-12-08 16:48:44
>>osrec+ZI
PHP had the advantage of having built-in resource limits and little contention over locks and other shared resources that meant sloppy coding wouldn't crash your server. Providers could offer low cost hosting plans because you could put a lot of customers on the same server and have very little trouble. It was a big plus that it was open source and didn't have the crazy high license costs of early dynamic web hosting solutions such as ColdFusion, WiTango, Netscape's application server, etc.
[go to top]