That's not naivety, that's a deficiency in PHP, you're fobbing it off as a problem in understanding, when in reality it's simply that PHP is poorly designed.
Well, I did quite some work in assembly. I didn't have any thread mechanism available as a core feature of the language, so I'd assume you'd also say CPUs are poorly designed.
There's nothing inherently wrong with wanting to send something off for processing in the background so that the main execution thread can return a response to the user.
No, there's not. What is wrong is the notion that you can only accomplish this by using threads.
The fact PHP can't do that is a problem with PHP, not naivety on behalf of someone wanting to do that because it's sometimes a legitimate thing to be able to do.
Sometimes I want to be able to issue syscalls. Its a legitimate thing to be able to do, and PHP doesn't allow me to do it easily. Or manage how memory is allocated. Or see an assembly dump of what's being executed. Well, its a limitation. So what?
If you think thread usage is purely about performance
I have great difficulty in having a valid discussion with someone that only performs a naive syllogism when reading a sentence, but I'll bite. If you're deferring tasks to be background processed so you can continue execution, it IS about performance, even though it wasn't what I wrote.
So what you really mean here is that PHP has a 3rd party beta threading implementation that may or may not work on your host
You mean, a package? Like basically every functionality available in every other language or operating system? Hey, PHP doesn't support Memcache also. Its an external package. And in Linux, bad luck - all those basic I/O functionalities are also available in a separate package. You know, like the one the JVM uses (GlibC).
If you do not have enough experience of web applications to realistically understand why you would want threads
Ahh the ad hominem attack. Well, I could say that if you cannot solve your problems without using threads you should be doing something else instead of programming, it doesn't really add nothing to the conversation, does it? By your reasoning, I'd say you're against using eg. PostgreSQL as a database server because isn't threaded. Oh well.
All this ignores the absurdity of the broken argument being made here - PHP is fine because it doesn't need threads, but it's got a barely working threading implementation because it doesn't need it, what?
PHP also has Sybase and Oracle support. I'd guess most developers don't really need that, and the language itself doesn't really need that, but exists. At this point I realize why you prefer to stay anonymous.
Before that it was solved in the most absurd ways by firing up a whole extra process with cURL, but you probably wont understand the performance implications of such a heavyweight action either.
Yah, probably not. I usually don't cater to smart-asses in the internet.
The worst part is, most PHP developers are at such an early stage in their development careers that they're not even equipped to understand why it's broken
So, it's the newbies fault, huh? I often see shitty production code done in Java or C# than in PHP, but it's obvious we have a different definition of shit.
No they wont, this is absolute bullshit. I don't care how good a programmer thinks they are, if the language has more gotchas then code written in that language will over time, be inherently more buggy than code written in a language with less gotchas, and therein lies the problen
Well, since you're so full of certainties, can you demonstrate it? If you have a look at http://www.computerworld.com.p..., you'll see that while the defect ratio of PHP is high, it is tied to a very specific set of defect categories. But hey, lets not spoil your rant with facts.
The problem is that most amateurs that think PHP is great don't even understand why their code is shit
Replace PHP with any language name. It's not about the language, its about the algorithm. And yah, I've seen some shitty algorithms done in "good" languages like C# and Java, and they weren't coded by amateurs.
. No programmer has ever written bug free software regardless of how big or small their ego but they'll write less bug free software in a language that eliminates entire classes of bugs (which the jump from dynamically to statically typed languages alone will typically do).
True, dynamically typed languages favor a specific set of defects. So why don't we write everything in Haskell? Why are you wasting time with Java or C# when Haskell is clearly superior?
It's just not the case - there's no longer a niche for PHP
The market says otherwise.
it's not faster to develop with
That's a bold statement. Are you comparing to Java? Yah its faster to develop with. Are you comparing to eg. Ruby? Maybe not.
it's not more efficient
Compared to what? It has a smaller memory footprint than equivalent solutions in Java, so it really depends on what you mean by "efficient".
it's not more performant
I can do web programming in assembly. I don't, but its not that hard. There are a bunch of obvious reasons why I don't do it. One of them is that, in most web cases, it doesn't really matter if the application takes 0.1ms or 5ms to execute.
it doesn't cost less
It does. A top PHP programmer can be upto 40% cheaper than a top Java programmer.
it's last remaining niche was the availability of cheap hosting
I'm currently finishing an application able to withstand 100K simultaneous users on a small cluster. I'd hardly call that cheap hosting, but hey, I'm not using wordpress.
because they're largely talentless and untrained
If you think programmer's talent is tied with the language, you're in for a big surprise.
you could hire 5 to release a masterpiece for the same price
This one made me laugh. I will take a hint from your book and assume - I'll assume you never managed developers nor designed a software product from scratch.
it's not clear that there's any benefit to PHP whatsoever over it's competitors any more
No one is forcing you to use it. Hey, I can't stand Python, does it make it a bad language? Hardly.
Yeah, except some of us like there to be less 1s and 0s so that our code is efficient
Bullshit. Efficiency has nothing to do with code size. And if you want that kind of efficiency, you're going to have a bad day with Java.
and we like our 1s and 0s to be ordered as they're supposed to be
As god intended, right? you're aware that most modern processors use out-of-order execution, right?
and so that they do what they're supposed to do
This fails more often than you might think, regardless of the language.
causing a vulnerability, poor performance, or an outright crash
So, shall I infer that those problems only occur in PHP?
(...) Java runtime not using the native multi threading implementation (...)
Well, AFAIK you cannot perform processing affinity on Java threads. And also AFAIK it's not part of the POSIX standard, so it's often up to the system scheduler (depending on whether you're using a userland implementation or a kernel-based one) to decide that. You ASSUME it will use all cores.
the realistic use case happens to support multiple processors
The realistic case is that you have no control over this in Java or a standard POSIX implementation. However, eg. Linux does provide extensions for this.
Also one of the features of multi threading is working around blocking API calls, one thread can work while the other is in sleep mode waiting for data from network or disk and the CPU would be otherwise idle ( of course using an async API when available is better ).
I'd suggest you look at some async subsystems to realize this often isn't really an advantage (GIANT was removed from Linux in 2011, not that long ago), and add it the complexity of syncing thread state and application state.
how slow it was
Contrary to popular belief, most applications doing real useful work wait the same time for the database, regardless of the language. Maybe a "hello world" is not a good example.
Unless you're one of the users running into those mysterious "memory leaks" that nobody can replicate once they file an actual bug
I stopped using Firefox a couple of years ago because of this. They're not mysterious, they were real. Try opening a reasonable amount of tabs (50-100), and leave the browser open for a day or two, and you'll probably be able to reproduce it.
The value of a thing is nothing more than more the price which people are willing to pay to acquire it.
So, why would you choose an unstable, national currency over a more stable, international one? As many african countries can attest, having your own currency is only effective if your economy is stable.
"It's when they say 2 + 2 = 5 that I begin to argue." -- Eric Pepke