

PHP Next Generation 213
An anonymous reader writes "The PHP Group has put up a post about the future of PHP. They say, 'Over the last year, some research into the possibility of introducing JIT compilation capabilities to PHP has been conducted. During this research, the realization was made that in order to achieve optimal performance from PHP, some internal API's should be changed. This necessitated the birth of the phpng branch, initially authored by Dmitry Stogov, Xinchen Hui, and Nikita Popov. This branch does not include JIT capabilities, but rather seeks to solve those problems that prohibit the current, and any future implementation of a JIT capable executor achieving optimal performance by improving memory usage and cleaning up some core API's. By making these improvements, the phpng branch gives us a considerable performance gain in real world applications, for example a 20% increase in throughput for Wordpress. The door may well now be open for a JIT capable compiler that can perform as we expect, but it's necessary to say that these changes stand strong on their own, without requiring a JIT capable compiler in the future to validate them.'"
If PHP was a horse in the prog language race (Score:4, Funny)
It should have been shot in the paddock.
Mind you at the other end of the spectrum we have the entry from academia "Haskell" that has already completed the course and is back in the stables. Unfortunately they haven't found a way to get it to interact with reality yet as that's an implementation issue.
Feel free to add an analogy to your language pet hate below.
Re:If PHP was a horse in the prog language race (Score:5, Funny)
PHP at least lets me set up a web site and get hacked.
Re:If PHP was a horse in the prog language race (Score:3)
See, back when mod_perl was a newer thing, we were having the same discussions about it. PHP just keeps working. People can (and do) bitch about its shortcomings, but it still works.
I am not a programmer by any stretch and even I have shaken my head at the way PHP does this or that over time, but that doesn't change its utility. It's very like perl in that regard, except it's actually useful for web development because it can be installed and web hosts provide it.
Re:If PHP was a horse in the prog language race (Score:2)
Well the real question what should replace it. I see so many PHP sucks comments but little response on what should replace it in terms of Web Development.
In terms of big names where we can find additional developers if we need easily we got the following.
ASP.NET: as actual ASP programming you are in a world of pain. But MS was nice enough to make an IDE that gives you other languages to code for it. But you are stuck on windows servers (Yes you have mono, but your code will be hit or miss)
Java ServerPages: This is better then ASP but still it is clunky. But at least it is Java based so you are going by decent Java Rules.
PHP: The language is rather inconsistent, a bad combings of many schools of thought... However it is easy to learn and implement, and it does its job.
We have had some fads come and go, they weren't all bad and there are still some people still using them. But don't expect too much growth.
Such as Ruby on Rails: You got a good language with a lot of good idea... However with rails all your apps look alike, and over time may seem outdated.
Re:If PHP was a horse in the prog language race (Score:2)
Same thing I've said many times.
"PHP Sucks! PHP Sucks! PHP Sucks!"
Fine, PHP sucks. Tell me genius, what should I be using? Because until you can provide a viable replacement, I'm still going to use PHP. Hell, I use PHP to write scripts when I need to access the mysql database.
[John]
Re:If PHP was a horse in the prog language race (Score:2)
I was talking about ASP.NET I didn't bring up ASP because it is out of date.
The fact that you have your source in multiple languages is confusing,
When you say it works with Mono Fully and add exceptions means that it isn't working fully.
Re:If PHP was a horse in the prog language race (Score:4, Insightful)
Still waiting for at least a half-decent argument that it "sucks". (I've seen the fractal article, and then I fact-checked it. Guess what I think about it now?) It seems uniquely well suited to its niche, and more than capable. More than 80% of websites seem to agree. You don't get that kind of market penetration by being "virtually unusable" like the Slashdot hive-mind seems to believe.
Who knows, maybe it does "suck" -- it just happens to suck significantly less than all the alternatives.
Re:If PHP was a horse in the prog language race (Score:2, Informative)
Did you fact check [phpsadness.com] it using PHP [phpsadness.com]?
Re:If PHP was a horse in the prog language race (Score:5, Interesting)
Did you fact check [phpsadness.com] it using PHP [phpsadness.com]?
I am not sure what that second bit of PHP sadness it really moaning about to be honest.
Ok, I understand the difference, but I also think that anyone who wrote code where the stacked ternary operators like that should be sacked. There are times when the ternary operator is useful, but it has to be used carefully if you want to keep your code easily readable by other people, stacking them like that is a quick recipe for unmaintainable junk useful for nothing else than building your own empire.
Also, wouldn't a few well placed brackets both solve the problem and make the code more readable?
Re:If PHP was a horse in the prog language race (Score:2)
You have a perfectly valid point about the fact that you should probably never write code like that anyway (I say probably because if I've learn anything in the world of programming it's that someone will always surprise you with a valid use case for something that otherwise seems unusable) but at the end of the day programming languages are tools of logic and so I would argue a key measure of a language is how logical it is - it's harder to manipulate logic, with illogical tools. Thus, an illogical component of a programming language must surely result in reduced marks for that language, no?
Re:If PHP was a horse in the prog language race (Score:2)
I've seen the fractal article, and then I fact-checked it
Did you fact check [phpsadness.com] it using PHP [phpsadness.com]?
I am not sure what that second bit of PHP sadness it really moaning about to be honest.
And that...is why you fail.
Re:If PHP was a horse in the prog language race (Score:2)
If you find stacked ternary operators confusing, how the hell would you manage to untangle a complex SQL query?
SQL's ternary operator is more beautiful (Score:2)
Re:If PHP was a horse in the prog language race (Score:2)
If you find stacked ternary operators confusing, how the hell would you manage to untangle a complex SQL query?
I have been doing this web development thing long enough now that I feel I can untangle just about anything given enough time, I have had to work on some serious drivel created by other people over the years. That does not make writing awful code a good idea though.
I generally work on the the principle of making sure that any code I write could be understood by anyone as easily as possible, even if they are not a super duper code ninja like yourself. The only exception would be if the more readable approach caused serious efficiency issues, but in those situations I try to over do the comments.
I generally consider the ternary operator to be useful shorthand but if I had to do lots of nested stuff like that I would write it as if-then-elseif-then-else which I find much clearer. It might involve more typing initially, but if it saves someone else time later then it's worth it in my opinion.
Re:If PHP was a horse in the prog language race (Score:2)
I understand the nuttiness of ternary operators being nutty, but who the hell is doing math with INF and -INF?
If you're doing complex math with PHP you're doing something horribly wrong.
Imaginary numbers, imaginary criticisms (Score:2)
If you're doing complex math with PHP you're doing something horribly wrong.
Then why does PEAR have a class specifically for complex math [php.net]?
Re:Imaginary numbers, imaginary criticisms (Score:2)
PECL has an OpenGL library, still doesn't mean it's a good idea. [php.net]
Re:If PHP was a horse in the prog language race (Score:5, Insightful)
The problem with everything you say, every comment you make on PHP and Javascript is that it goes along the lines of:
"Still waiting for at least a half-decent argument that it "sucks". (I've seen the fractal article, and then I fact-checked it. Guess what I think about it now?)"
Please elaborate. Tell us what you found not to be true in that article, tell us what your fact checking discovered. Don't just say "I fact-checked it" and then that obviously means it wrong. Guess what you think about it now? I've no idea given that you've never ever managed to counter it at all, are you perhaps thinking "Fuck it's right, but I can't rebut it, so I'll just pretend it's wrong"? Did I guess right?
"More than 80% of websites seem to agree."
Where is the evidence? Even if true what proportion of major players use PHP? Very few serious players who have to maximise stability, performance and security do - Twitter? Nope, Google? Nope, eBay? Nope, Amazon? Nope, Slashdot? Nope, BBC? Nope, Microsoft's sites? Nope, Apple? Nope, YouTube? Nope, Blogger? Nope, LinkeIn? Nope. Facebook goes near it but even they've been translating it to C++, or trying to convert it into Java with a JIT for the last 5 years. Other than that there's what, Wikipedia and Yahoo? Fact is in major sites even Python has more of a showing than PHP. Even if PHP is used in more sites, it's used in less serious sites that actually matter so sure PHP may be prolific in first time or throw away sites, but if you're doing anything as a business, if you're doing anything where you want security, stability, and performance, then PHP is not a viable option. You don't find PHP in banking or most of the major eCommerce sites for example, it's Java for the most part.
Look, I'm not saying you're wrong about PHP, but you're infuriating to have this discussion with because no matter how hard I or anyone else tries you just never back up your claims. You just make comments like "There's nothing wrong with PHP", "The fractal article is nearly all wrong", but you can never prove it, you can never elaborate, you can never expand on it. I can't tell if you're a shill or a troll, I find it hard to believe you're anything else for the simple fact that you're so utterly evasive in justifying your arguments.
The "PHP is a fractal of bad design" article is a long well argued piece on PHP. If you want to have it declared wrong you similarly need to take at least some time to tear it apart. Simply saying something is wrong doesn't make it so, you have to explain why and how it is wrong.
Until you can start backing up your claims, one can only assume you're simply full of shit - a troll, a shill, a fanboy, whatever. You need to start justifying your claims - those criticising PHP have done so time and time again, and many just point to fractal precisely because it saves them having to repeat those already well established points. I've yet to see anything that can counter it, the best I attempt I saw was this forum rebuttal:
http://forums.devshed.com/php-... [devshed.com]
The problem is, the author of it only manages to demonstrate how little he knows about software and programming, rather than demonstrating that article he's disputing is wrong in many, or even any ways. I would love to have my knowledge expanded by being informed as to the many ways in which fractal is wrong but all those of you that claim to have this knowledge seem unwilling to provide it, is there some curse on it? will the world end if you tell us why fractal is wrong or something?
Long story short, less fanboy, more facts please, and if you're not willing to start arguing your case with facts then stfu because I'm sick of seeing PHP articles flooded with unsubstantiated fanboy nonsense. You're like the annoying religious guy who argues that god exists just because he does and that's all there is to it, you can't justify the claim, you can't explain why, but you've decided in your head he's real without any justification so that's it he absolutely must be.
Re:If PHP was a horse in the prog language race (Score:2)
(hi narcc)
Re:If PHP was a horse in the prog language race (Score:2)
The AC is not me. Nice troll attempt, through.
In the past, I've commented on various parts of the fractal article. I'm sorry you missed them. it may have saved you a long pointless rant.
It's a huge rant, and I'm not going to go through it line-by-line on a forum post. It would be a waste of time as I'm sure you'd simply find one debatable point and use that to dismiss the entire thing. That's how such things on slashdot always go.
That's why I invite you to fact-check the article yourself. You can hunt down my criticisms if you want, but it's much easier for you to put those critical thinking skills to work and evaluate the article on objective terms. You'll find that the bulk of it is unsubstantiated opinion, and many of the "facts" are just flat-out wrong.
Re:If PHP was a horse in the prog language race (Score:2)
You don't have to pretend you're not the AC, I couldn't really care less, especially as you've taken the opportunity to come out of hiding anyway now.
"In the past, I've commented on various parts of the fractal article. I'm sorry you missed them. it may have saved you a long pointless rant."
Please link to this, I'd love to see it.
"It's a huge rant, and I'm not going to go through it line-by-line on a forum post."
So why not create your own page to summarise your arguments like the guy who wrote the fractal article did? Then you can just link to it.
" It would be a waste of time as I'm sure you'd simply find one debatable point and use that to dismiss the entire thing. That's how such things on slashdot always go."
So you mean kind of like the exact debating tactic you've been using all along that I've been railing against you for using? Don't you think that's a bit hypocritical? It sounds just like an excuse to me.
"That's why I invite you to fact-check the article yourself."
I have and I can't really find much wrong with it, maybe a handful of errors out of hundreds of points. By and large it's exactly right.
"You can hunt down my criticisms if you want, but it's much easier for you to put those critical thinking skills to work and evaluate the article on objective terms."
Yep, that's what I've done and it turns out you're wrong. You tell us you're not, but you still evade justifying the argument that you're not wrong, you just say you're not and leave it at that. In fact, that's exactly what you've done yet again here right now. Why am I not surprised? You still seem more interested in arguing why you shouldn't have to justify a point when you could just as easily justify a point, why is that? why such desperate attempts at evading the issue?
The problem is you've made it clear before you haven't even used PHP much, well, here's the thing, I have. I've used it in large professional projects, I've also used other languages like Java, C++, and C# in large professional projects too. I've got something you don't - first hand experience of PHP's problems, yet you still seem to think they don't exist. How can you even make that argument when you've admitted yourself previously you don't have any degree of worthwhile experience with it? Do you just like arguing in defence of a language for no other reason than to play devil's advocate even though you don't have a basis on which to do so or what? Is it just because you hate other OO languages like C++, Java, and C# with such a passion that you feel the need to defend anything that isn't them? I'd just love to know given your lack of experience with something why you go out your way to so vehemently defend it regardless using the most dishonest methods of discussion in the book.
I get the impression you're very academically oriented, rather than real-world development oriented. I suspect that's as much where you fail to grasp the problems with PHP in the real world. You say they don't exist, but I assure you they're very real, which is not to say PHP doesn't have a place - as Gaygirlie mentioned in this discussion it works fine for her personal hacks and stuff, and that's fine. But for professional projects that require any degree of scale? Hell, even there it can work. It just doesn't work anywhere near as well as the alternatives, and it brings much more risk and cost to a project, and that's the problem.
I see three types of PHP developers here:
1) Those who use it in small scale personal projects and don't do anything big enough or important enough to run into any of it's issues
2) Those who realise it's shit but suck it up and enjoy the fact there's still money to be made in shitty plugins for shitty CMS' with it and so on. They'll put up with it for the decent contracting rates and will defend it on that basis, not on the basis of technical excellence or any such thing.
3) People who are in high end roles such as senior or lead development positions that have experience o
Re:If PHP was a horse in the prog language race (Score:2)
You can knock-off your silly attempt to discredit me, accusing me of posting as an AC to support my own post. No one is buying it. It's also not relevant to the topic at all.
You've written a book here. Why does it bother you so much that people like something that you don't like?
The problem is you've made it clear before you haven't even used PHP much
That must have been in your imagination. I've never said anything that would imply that.
So why not create your own page to summarise your arguments like the guy who wrote the fractal article did? Then you can just link to it.
I'd like to point out that you did, in fact, link to an article that addresses (some) of the shortcomings of the fractal article. There's even a discussion below which includes the fractal author. You ignored the facts there, what possible hope do I have?
I'm sorry that reality does not conform to your preconceptions. That's not my fault.
I see three types of PHP developers here:
I'm sure you've done the relevant research prior to drawing that conclusion, right? Oh...
I get the impression you're very academically oriented, rather than real-world development oriented.
I honestly don't see anything wrong with that. I'll also note that most (if not all) of the "real-world" development stuff you run across is worse than useless -- the technical equivalent of self-help books. You'd think the guys in the trenches would notice, with the never-ending parade of fads competing for their attention, and start to demand actual research to inform them.
The problem with this "feelings" based approach that's become so popular is that it doesn't actually inform you. You don't like PHP. Rather than try to work out why, you do a google search for "PHP sucks" or whatever and try to find reasons to validate your feelings. When you run across an article like the fractal article, which is absolutely abysmal, you feel like you've hit on something akin to real research. It's not. (You'll find many of his facts are flat-out wrong, and the bulk of the article is completely unsubstantiated opinion.) Even worse, it actively discourages you from using your critical thinking skills to make an objective evaluation.
I've not found anyone who works with it to any reasonable degree, who has worked with other technologies to allow them to compare, and who actually likes it.
Check this very thread. Hell, check this post.
If what you say is true, that it's actually fine, then where are all the high end professionals (i.e. not just amateurs and people at the junior level) that use it and actually like it?
Check this thread. If that doesn't satisfy you, consider that PHP powers >80% of websites (a link for you) [w3techs.com] not just small sites, but also major sites like Yahoo and Wikipedia. You don't get that kind of marketshare by being a virtually unusable mess, like some folks here seem to believe. You get that kind of marketshare by being better suited to the task than competing languages.
I don't think you'll need to look too far to find "high end professionals" (I wonder what your criteria for that would be?) that actually like it. You've got an awfully big pool of users to draw from.
As you're practically minded, why not ask yourself how PHP became so popular? Why has it continued to grow year-after-year in the face of increasing competition and decreasing reputation on sites like Slashdot? How do the alternatives compare to it in practical terms?
Granted, very awful things can also become quite popular, though you can usually find a good reason for it. That's something exploring questions like the above can help discover.
Re:If PHP was a horse in the prog language race (Score:2)
"When you run across an article like the fractal article, which is absolutely abysmal, you feel like you've hit on something akin to real research. It's not. (You'll find many of his facts are flat-out wrong, and the bulk of the article is completely unsubstantiated opinion.) Even worse, it actively discourages you from using your critical thinking skills to make an objective evaluation."
We don't seem to be getting anywhere. You're still parroting the same old thing whilst evading backing it up by explaining where exactly it is wrong. I've been asking you for an objective evaluation all along, that's been the very point of every one of my posts - to get an objective evaluation from you, but you just cannot provide one can you?
"I honestly don't see anything wrong with that. I'll also note that most (if not all) of the "real-world" development stuff you run across is worse than useless"
That doesn't make any sense. How can real world stuff be useless? By definition real world stuff is stuff that's used in the real world, and hence, not useless. I don't have any inherent problem with the academic view of the world, as long as there's recognition that it doesn't necessarily play out in practice. Case in point I had a grouchy old comp. sci. professor who declared his distaste for the fact that proof by induction wasn't carried out on every bit of code on earth to make better more secure software - that's a great theory but if we did that then we'd never actually get anything done. Theory isn't fact, and fact can diverge from theory in practice, that's something academics can sometimes get wrong. Even your signature highlights this- as awful as OO might be, it's still been better than anything else for actually getting most software built in practice over the last 20 years so someone like Djiksta can rally against it all he wants (though I hear that quote actually never came from him anyway) but it doesn't change the fact that there's been no better alternatives for practical large scale development until recently.
"consider that PHP powers >80% of websites (a link for you) not just small sites"
I'm glad you finally tried to justify at least one of your points, but by way of objectivity one has to consider why that's so massively contradicted by for example this site which puts it at only 18.6% marketshare:
http://trends.builtwith.com/fr... [builtwith.com]
We need something more transparent with it's data, neither of these sites are. Putting that aside and giving your link the benefit of doubt for now, even your link highlights the fact that PHP is mostly powering small sites - it's bottom of the list by measurement of how much it's used in high traffic sites. This reiterates the point that it's mostly just used for unimportant stuff, more often than not PHP's growth comes from installations of things like Drupal or Wordpress for personal sites that just end up getting left to rot, which is fine, but it means much of it's usage has nothing to do with how much it's being used as a language for software development. Installation of a copy of Drupal is not the same as writing any actual PHP code.
Re:If PHP was a horse in the prog language race (Score:2)
You're still parroting the same old thing whilst evading backing it up by explaining where exactly it is wrong.
It would be easier to point on the bits it gets right! As I've said before, just about everywhere. You have a link which points out a few problems with the article, but refuse to accept reality.
If it's that important to you, pick a section of the article and I'll help you evaluate it. You clearly need the extra hand-holding.
Of course you'll need to know the difference between fact an opinion. From the nonsense article:
PHP does not overload +. + is always addition, and . is always concatenation.
Need some help?
While it is a fact that + is not overloaded and . is always used for concatenation, that this is a bad design choice is purely opinion. I don't mind opinion so much, as this is a subjective sort of thing, but unsubstantiated opinion is worthless. Why does he think this is a problem? I'll never know. "It's bad design 'cause I don't like it!" isn't very convincing.
Now that that's out of the way. Before you post the section you want to discuss, save us both some trouble by first stripping out any empty rhetoric (like the analogy section) and any unsubstantiated opinion. What's left should be points of fact and arguments. We can tackle those individually.
Once you have some experience making an objective evaluation, you can tackle the rest of that ridiculous article. I suspect that you'll stop quickly, once you realize that it's not likely to improve.
That doesn't make any sense. How can real world stuff be useless? By definition real world stuff is stuff that's used in the real world, and hence, not useless.
Not a big thinker, are you? Useless, as in "offers no practical benefit". I'll take it a step further and say that most "real-world" development trends are worse than useless. Offering not only no practical benefit, but are actually harmful.
Re:If PHP was a horse in the prog language race (Score:2)
"It would be easier to point on the bits it gets right! As I've said before, just about everywhere. You have a link which points out a few problems with the article, but refuse to accept reality."
So the issue then is you have a distorted view of what reality is it would seem. What exactly makes the "rebuttals" correct, but not the original authors response to those "rebuttals"? You've still got the same problem, you need to elaborate why the original author is wrong. This is still a thing you seem completely unable to do.
"While it is a fact that + is not overloaded and . is always used for concatenation, that this is a bad design choice is purely opinion. I don't mind opinion so much, as this is a subjective sort of thing, but unsubstantiated opinion is worthless. Why does he think this is a problem? I'll never know. "It's bad design 'cause I don't like it!" isn't very convincing."
That would be a good start if you didn't quote out of context, full quote:
"Despite the craziness above, and the explicit rejection of Perlâ(TM)s pairs of string and numeric operators, PHP does not overload +. + is always addition, and . is always concatenation."
So he's not saying it's bad in itself, he's saying it's inconsistent, because in some cases the language designers have opted to avoid explicit operators and go for operators that work in multiple contexts, then in others they've chosen not too. It's like they couldn't decide what their policy on that was - are they going to have unique explicit operators or not? The language design is too ad-hoc.
But despite the fact you clearly got this one wrong and tried to hide it by quoting out of context, I don't want to discourage you now you're finally at least trying to justify your point, so go ahead find a few more. You don't need me to pick a section for you, I'm offering you better than that - I'm letting you choose from the entire article, and given that you feel it's almost all wrong it'll be easy for you to find a whole bunch of other things to argue against wont it?
"Not a big thinker, are you? Useless, as in "offers no practical benefit". I'll take it a step further and say that most "real-world" development trends are worse than useless."
Okay I can see you're getting flustered now at being called out on your unjustifiable arguments by the amount of insults you've started resorting to spewing, but given that you seem to have no worthwhile real world development experience why do you feel justified to make these comments? How can you make a claim when you have no grounding to base it on?
You talk about objectivity, but I've done a lot of academic study, and have a lot of professional real world experience, as does the guy who wrote the fractal article I believe. Why are you so certain in your academic bubble that your view is somehow objective when it by definition, due to lack of broader experience cannot be? You cannot preach objectivity from a position of complete ignorance about the other side of the argument. Even then your academic background is clearly not rigorous given the level of inconsistency and poor design you defend in PHP. PHP certainly doesn't fit the mathematically grounded academic rigour that would please any of the greatest academics in the field of computer science either.
Re:If PHP was a horse in the prog language race (Score:2)
Oh, the article I mentioned in the post to which you replied?
I guess you didn't bother read the next sentence before posting. I said before, I gave it fact-check it. Can you guess the results?
Re:If PHP was a horse in the prog language race (Score:2)
can you even spell?
Re:If PHP was a horse in the prog language race (Score:3)
The PHP Hamer:
https://www.flickr.com/photos/... [flickr.com]
What about PHP on the JVM? (Score:2)
Re:What about PHP on the JVM? (Score:2, Funny)
Any chance you could throw some Haskell and M4 macros in there, too?
Re:What about PHP on the JVM? (Score:5, Funny)
"Yes, that's just what the world needs: the rigorous code quality of PHP combined with the high performance and lightweight Java Virtual Machine."
Fortunately, I had already swallowed my coffee so the keyboard was safe.
However, your point is valid. Just because you can theoretically run something on something doesn't mean it's a good idea.
Anyway, I need to get back to writing a JVM in VBA. This is going to be the tits.
Re:What about PHP on the JVM? (Score:2)
Re:What about PHP on the JVM? (Score:4, Interesting)
Doesn't seem like a bad idea. HotSpot will likely always be faster, more secure and more reliable than any VM the PHP devs cobble together.
I'd rather code COBOL or FORTRAN (Score:3, Insightful)
I've had the misery of suffering with maintaining a few PHP applications over the years. It is, bar none, THE WORST LANGUAGE I have ever used. Even COBOL does a better job of handling the humungous amount of copy-paste code that PHP requires. Even FORTRAN does a better job of error checking before run-time.
Sure, it's popular.
So is McDonald's.
That doesn't mean it's good or good for you.
Re:I'd rather code COBOL or FORTRAN (Score:5, Funny)
PHP is great when you need to deliver a working prototype yesterday and someone else will have to maintain the code.
Re:I'd rather code COBOL or FORTRAN (Score:5, Insightful)
PHP can be used for production stuff as well, if you're careful. I was involved in building a mission critical system for a large corporation, and we selected PHP since the client already had a sizable pool of experienced PHP developers. We built the system relatively quickly and had little trouble handing it over to the team handling maintenance and enhancements, and it's been running happily ever since. What helped was applying good common coding sense, such as extensive error handling, and comprehensive unit testing against the documented functionality of each module / function. I've used far worse languages...
Re:I'd rather code COBOL or FORTRAN (Score:2, Insightful)
I think that a lot of the criticism PHP gets is undeserved.
If used correctly, PHP can be a very clean language. If you use the object-oriented facilities, it is as capable and clean as any other high-level language.
The biggest problem with PHP is that it's also a very forgiving language, as in, it pretty much allows a novice programmer to get results quickly and easily with horrible, unmaintainable code.
This is a double-edged sword, and since most programmers never evolve past novice status, it has polluted the well and resulted in PHP's crappy reputation.
On the other hand, that very friendliness is what made PHP so popular, but that in itself is a good thing: nowadays if you develop your application in PHP, you're pretty much guaranteed to be able to host it from any server you can think of.
But as I said, PHP applications can be done well, you just have to be aware of your coding practices and enforce them on your team.
Re:I'd rather code COBOL or FORTRAN (Score:4, Insightful)
Yes I have used Python, actually. and I've found the same thing ESR discovered about it years ago. Python promotes rapid development with fewer errors than many other languages. And it's generally clean and extremely easy to read. Python has its warts of course. And gotchas. PHP has its good points and bad points as well. But to try to disparage Python just to make your point that PHP is great is pretty silly. If PHP is great it should stand on its own regardless of your personal language preferences. And I think it can. That's not to say, of course, that PHP does not have many problems as a language; it does.
This is why PHP continues to thrive (Score:5, Interesting)
Despite all hatred - and let's face it, PHP is a really strange phenomenon - this is why PHP continues to thrive. The PHP community gets from A to B by the most bizar reroutes across Z, Mary Poppins and f(x)=x^2e^x-2. PHP is a fractal of bad design [eev.ee], but they always seem to focus on the next issue that's simply in the way of getting the next real world job done. I've written a post on that a few weeks ago [slashdot.org].
Them checking the performance of Wordpress (one of the large popular CMSes out there, with a really shitty architecture ... like most of its kind) as a benchmark for the foundation of a VM show how 'fast result' oriented the PHP community is. The idea itself of testing like this would seem insane to any serious developer, AFAICT.
Point in case for PHPs insanity that always seems to work out in a strange way: ... sort of like line-numbers, but not quite ... its really crazy ...). If PHP is a fractal of bad design, Typo3 classic is that ^2. It's very difficult to describe, you have to experience it for yourself to fully understand. It's like taking the red and the blue pill at the same time. Seriously.
I've fought it for over 12 years, but now I've finally given in and am working myself into Typo3, a big-league player in the world of PHP Web CMSes. Let me tell you: If you think Wordpress, Drupal or Joomla have an architecture that was designed by chimpansees (I should now, I've deployed Drupal and Joomla professionally and was on the Joomla Bugsquad), Typo3s has one that was designed by amobeas. With TypoScript - the T3 template and config language - they've got the textbook example of an inner platform (think PHP but non-turing complete for configuration and with magic numbers
Anyway, I'm veering off. The point is: ... Although TypoScript is one of the strangest things I've seen in my 28 years of computing, I have to admit. Think of Typo3 as the Vi and Emacs of CMSes, all rolled into one. Yet there are over 2000 official Typo3 agencies here in Germany. Being an online agency basically means being a Typo3 agency over here. What do you say, it's what people want. T3 is a household brand, it has an official association, a neat website and the vibe of "big, complicated and professional" all over it. The customers want it, and they're willing to pay for deployment in T3. Who am I to complain?
Knowing Typo3 is basically job security galore for any web developer in Germany. Period. I've agreed to dive into T3 and am right now scoring more than 60Ã an hour. Being able to edit templates in the CMS Admin area isn't bad either.
PHP is bad, and nobody cares. Its barrier of entry is basically non-existant, security issues be damned, and they have a slew of pointy-clicky stuff for the peddlers to sell to end-customers. All for free. The most succesful FOSS projects are written in it and if the PHP crew are going to stick to their crazy "make it work, then make it beautiful" approach, it's probably going to stay that way for a long time.
My 2 cents.
I confirm: The Beta UI is really shitty! (Score:3)
See the double post? You can thank beta for that. Mod this one down or turn it off if you are an editor, the one below is the final version.
No more beta for me.
Re:This is why PHP continues to thrive (Score:2)
Typo3 - good lord what an utter piece of crap and a UX nightmare. You hit it on the head with job security - that's why it's always been hard to use and always will be. And TypoScript. Words cannot describe the "why does this even exist?" cry from my soul every time I had to look at it.
Part of the reason I quit my last job was because of Typo3. If I never see it again, it will be too soon.
Re:This is why PHP continues to thrive (Score:2)
In a lot of cases it is easier to re-write a php program than to fix it.
People have been making the same complaint about code in all languages since forever. If that is the strongest indictment against PHP, then it is one of the best languages ever created.
Re:This is why PHP continues to thrive (Score:2)
Incorrect. Runtime and frameworks have a large impact on security. The implication of your argument is that every runtime and framework is completely secure such that the only place security vulnerabilities can exist is in bespoke code. Obviously this is false, so leave security to professionals who actually know what they're on about please. There's enough PHP developers out there causing most of the world's web facing security risks, we don't need more of you exacerbating the problem with such demonstrable cluelessness.
Re:This is why PHP continues to thrive (Score:2)
No. it came first
Because no one used Perl, right? Oh, wait...
PHP won because it was really easy to deploy and really easy to use. Far easier than Perl. That's why there are so many "shitty" PHP developers and so much awful PHP code out there -- there's virtually no barrier to entry. For some inexplicable reason, people take this to mean that the language sucks.
Insecure developers HATE anything and everything that's easy to use. It threatens their jobs, and their egos.
Comment removed (Score:2, Insightful)
Re:Well, I, for one, like it (Score:2)
Re:Well, I, for one, like it (Score:2)
Re:Well, I, for one, like it (Score:2)
How is that a problem?
Why do think we have programming languages, if not to make writing programs easier?
If a language makes writing code easier, that's a good thing. That's the entire point of using a high-level language.
Re:Well, I, for one, like it (Score:2)
Sure kid, and I can tow a tractor trailer with a Toyota Tacoma pickup if I swap transmissions to gear it low enough and equip it with wide tires, but it's not the optimal solution.
If you had just gotten a Tundra you could tow the space shuttle.
PHP Upgrade? (Score:2)
Re:PHP Upgrade? (Score:2)
Re:PHP Upgrade? (Score:2)
Comment removed (Score:2)
PHP? (Score:2)
Is that thing still around? [eev.ee]
Re:PHP? (Score:2)
get a life.. for real. Always easy to play MMQB, harder to actually *do* something.
I've worked with PHP and its assorted web frameworks enough times to completely relate to what that site tells.
That an amateur language like PHP holds 80% of the web marketshare seems insane until you actually realize that 80% of the web is hardly professionally developed either.
Re:PHP? (Score:2)
A shame you've never given it a good fact-check. That site is just short of being complete nonsense.
Re:PHP? (Score:2)
Really? Most, if not all of it, is stuff i've ran into in the past. The nonsensical comparison operator results and the so-called "arrays" pop into my mind right now...
Re:PHP? (Score:2)
The nonsensical comparison operator results
I see. You're just confused by dynamic languages. Try the same operations in C, with the relevant casts, and note the results. Hey, look at that! Not quite so "nonsensical" now, is it?
Like I said, give that article a good fact-check. You'll regret ever recommending it.
Re:PHP? (Score:2)
I see. You're just confused by dynamic languages. Try the same operations in C, with the relevant casts, and note the results. Hey, look at that! Not quite so "nonsensical" now, is it?
Like I said, give that article a good fact-check. You'll regret ever recommending it.
"Dynamic languages" eh? Show me a "dynamic language" where i can do this (blatantly stolen from this site [phpsadness.com]):
$ cat circular.php
<?php
$a = INF;
$b = array();
$c = (object)array();
var_dump($a < $b);
var_dump($b < $c);
var_dump($c < $a);
$ php circular.php
bool(true)
bool(true)
bool(true)
You're right though. Nonsense confuses me.
Re:PHP? (Score:2)
Can't read the documentation, eh? Object and anything, object is always greater. Array and anything, array is always greater. Object has precedence.
Think: How would you compare a double to an array anyway? How would you do it in other languages? What would the results be, provided you did the appropriate type conversions?
This stuff isn't complicated.
Re:PHP? (Score:2)
No, it should not be complicated. It does not make sense - PHP is the only, and i mean only language i found with comparison rules that are non-transitive. And even worse, circular.
Re:PHP? (Score:2)
That's flat-out wrong!
You'll find that many languages, not just dynamic languages, have comparison rules that are not transitive -- C included -- when you make comparisons between different types.
Perhaps you should spend less time parroting nonsense you hear on the internet and a bit more time evaluating your beliefs.
Re:PHP? (Score:2)
Dude, you are the one who's flat out wrong. Not only C has transitive relationship operators, but the language specification actually states that value comparison operators must be transitive except in cases where precision is lost in type-casting of operands.
So, for example, this might fool the typical PHP developer...
int main(void) {
unsigned long a = 98765UL;
int b = -12345;
short c = 1;
if (a < b) printf("a < b!\n");
...while you're simply rounding off (modifying!) operands in the process. This can be easily show by controlling how casting is performed:
if (b < c) printf("b < c!\n");
if (c < a) printf("c < a!\n");
}
int main(void) {
unsigned long a = 98765UL;
int b = -12345;
short c = 1;
if (a < (long)b) printf("a < b!\n");
if (b < (int)c) printf("b < c!\n");
if (c < (short)a) printf("c < a!\n");
}
Compare this to the brainfuck that is PHP, where comparison rules are well stablished [php.net] but still manage to produce this crap [phpsadness.com]. I can't believe i'm actually discussing this.
Re:PHP? (Score:2)
I can't believe that, in the face of evidence to the contrary, you're holding on to your absurd beliefs.
Not only C has transitive relationship operators,
Just like PHP!
value comparison operators must be transitive except in cases where precision is lost in type-casting of operands.
Just like PHP, where comparison operators are transitive except in cases where precision is lost in type-casting of operands.
The difference, of course, is that no one says C's operators aren't transitive even though they behave like PHP's operators once differences in types are taken in to account.
Now, if had even a minimal understanding of dynamic typing, you wouldn't say such absurd things.
Look, this is a simple point-of-fact. You can do the experiment yourself, quickly and easily. The results are irrefutable. You've been parroting nonsense. You'll get over it.
Re:PHP? (Score:2)
Just like PHP!
Just like PHP, where comparison operators are transitive except in cases where precision is lost in type-casting of operands.
Yeah. I'm dying to know what the "loss of precision" is when comparing a float to an array to an object.
No, you know what? I don't. Go have fun with your toy websites.
Re:PHP? (Score:2)
Yeah. I'm dying to know what the "loss of precision" is when comparing a float to an array to an object.
Gee, I wonder. Converting a non-numeric type to a number... Hmmm...
Are you really this thick?
Deny reality all you want. Just do the world a favor and stop spouting nonsense.
Re:PHP? (Score:2)
Man you get proven wrong in like every conversation thread on this page. /. cheevo for that.
There has to be some kind of
Re:PHP? (Score:2)
Really? Because it looks like she agreed with me completely.
You'll find that many languages, not just dynamic languages, have comparison rules that are not transitive -- C included -- when you make comparisons between different types.
To which she replied:
Not only C has transitive relationship operators, but the language specification actually states that value comparison operators must be transitive except in cases where precision is lost in type-casting of operands.
In contrast to her earlier claim:
PHP is the only, and i mean only language i found with comparison rules that are non-transitive.
How does that make me wrong again?
Re:PHP? (Score:2)
In ways you cannot undersand, evidently. The distinction on C when comparing type-casted operands is precisely because casting is guaranteed to destroy precision - operands are effectively modified in the process. This has NOTHING to do with the way relational operators work: they behave in a sane way, like they do in every other language on Earth.
Now contrast that with the idiotic PHP decision of setting rules for relational operators leading to circular logic. I know the "this might fool the typical PHP developer" warning went over your head, but ponder on this: on my original PHP code snippet, where's the "loss of precision"?
Where's the casting?
Hell, where do you apply your "object has precedence" mantra on it?
I really can't believe that someone could not only defend this madness so vehemently, but also without really understanding what he/she is talking about. Try a new language, son. It will open your horizons.
PS: I'm a he, not a she.
Re:PHP? (Score:2)
Watching narcc trying to argue that PHP isn't a bad language is like watching a 3 year old repeatedly trying to ram a square peg into a round hole.
It's funny at first, but then you feel bad and try and help him, but the problem is this kid's just too dumb to be helped and so he just sits screaming and crying at people instead.
He's openly admitted previously he has little or no experience using PHP though, and also clearly has no experience with any other languages. In fact, it's hard to tell if he's even a programmer full stop. His inability to recognise bad things in PHP (and Javascript, he's the same with that for what it's worth - he doesn't even understand why variables that haven't been declared with var defaulting to global scope is a bad thing for example) that anyone who has worked with C, C++, C#, Java, or many other languages would spot immediately implies he really has no worthwhile programming experience.
Re:PHP? (Score:2)
Oh, and by the way. Why do people insists on comparing PHP to C? Isn't PHP supposed to be a high-level, website oriented scripting language?
I ask because i've seen bugs about PHP segfaulting reliably [php.net] rejected only because "this behavior is consistent with what lower level languages like C do". It's like watching an exploit slowly growing from its infancy.
Re:PHP? (Score:2)
Oh, and by the way. Why do people insists on comparing PHP to C?
Because it's a language that others are likely to already understand. PHP is also written in C, which likely influenced the language.
Re:PHP? (Score:2)
Because it's a language that others are likely to already understand. PHP is also written in C, which likely influenced the language.
So are Python, Perl, Ruby and Java, and you won't see anyone comparing them to C. That's a poor argument.
Re:PHP? (Score:2)
It's not an argument. It's speculation as to why it's often compared to C.
Don't blame me, you asked for exactly that!
The Next Generation? (Score:2)
I read the title and immediately envisioned Data hacking PHP code on the Enterprise...
To be fair... (Score:2)
... it would be hard to make its APIs much worse.
PHP isn't the bottleneck (Score:2)
Speed up PHP? It already runs in a fraction of a second. The database queries, meanwhile, can take many times longer.
Re:I got tired of waiting (Score:5, Interesting)
I've mostly just stuck with Perl and Bash, and I'm still not sorry.
Re:I got tired of waiting (Score:5, Insightful)
JS on the server is clearly big contender for PHP: it's great for quick and dirty prototyping, awful for large projects, and significantly faster than PHP.
JS is the perfect recipe for language lock-in that's even stronger than PHP: front end developers already "know" it, they write a botched version of the backend code that 10 years later turns into an incomprehensible behemoth; any attempt to rewrite it will be rejected for "performance" reasons.
Re:I got tired of waiting (Score:2)
it's great for quick and dirty prototyping
I've heard this for nearly every interpreted language. The only problem is: that quick and dirty prototype almost always winds up being the production codebase.
Re:I got tired of waiting (Score:2)
Re:Only on paper (Score:3)
Personally, I blame the MySQL team for nightmares like phpBB and vBulletin. After all, mysql_query is still available in the language, despite being at fault for a staggering percentage of PHP application security flaws. The PHP folks have at least finally deprecated it in 5.5, and theoretically it will go away in the future, though at this point it is so ingrained that when they do, most folks will just reimplement it using a template-based query, but with no template fields, and we'll be in the same boat as we are now.
In an ideal world, that function/method should never have existed in MySQL to begin with. But even if we accept that it was unavoidable, the function/method should have been removed from MySQL a decade ago, because even way back then, it was obvious how flawed an API it is. Had they done so, it wouldn't have continued to exist in the PHP bindings, because it wouldn't still have been in the library.
The rest of the security problems with PHP are, as far as I can tell, pretty much comparable to any other language—improper quoting of content for use in various aspects of HTML output, cross-site scripting bugs, etc.
BTW, if you want a PHP bulletin board that's more sane, check out JaxBoards, and grab my fork where I rewrote every single database call to use template-based queries. It's a fairly clean design that separates the presentation from the core to a significant degree, and whose database code is fairly straightforward. If you spot any security bugs that I haven't already fixed in my branch, let me know.
Re:I got tired of waiting (Score:2)
You wanted speed and you moved to Python? :DDDDDDDD
Re:I got tired of waiting (Score:2)
It's still faster than Ruby. :D
PS: I love both anyway.
Re:I got tired of waiting (Score:4, Insightful)
From inconsistent to consistent
You're talking about Python, right? It may be a lot of things, but consistent isn't one of them.
From difficult to scale to easy to scale.
Again, Python? Also, I wasn't aware that PHP was "difficult to scale". No one else seems to have trouble with it. Well, "double-digit percentage of total internet traffic" sites excepted, of course. Though at that point, just about everything is "difficult to scale".
From crappy web frameworks to excellent web frameworks
I've never seen a "web framework" I'd classify as "good", let alone "excellent".
I'm still floored by the Python recommendation. This is a language that couldn't even get a simple print function right until version 3. A language so fundamentally flawed that the syntax can't adequately handle its features (anonymous functions, for example). A language known for abysmal performance. A language that can't even maintain compatibility between minor versions.
You want people to invest in that? That's just crazy.
Re:I got tired of waiting (Score:4, Insightful)
> You're talking about Python, right? It may be a lot of things, but consistent isn't one of them.
Python's inconsistencies are bizarre enough that they become easy to remember, and there aren't that many. PHP's inconsistencies are much more subtle, and are everywhere. Peruse the string functions for a good example...
> Again, Python? Also, I wasn't aware that PHP was "difficult to scale". No one else seems to have trouble with it. Well, "double-digit percentage of total internet traffic" sites excepted, of course. Though at that point, just about everything is "difficult to scale".
for web apps I'd assume python and PHP have the exact same problems, and more or less the exact same solutions. PHP is going to be slower if you use mod_php over php-fpm though, which many don't do. As well, it's a lot easier to write up performance-dependent code in C when using python than when using PHP.
> I've never seen a "web framework" I'd classify as "good", let alone "excellent".
You should elaborate on this. Are these just frameworks for PHP and Python or are you being language agnostic with this statement? I've grown comfortable limiting my webapps to just RESTful APIs that frontends use and whipping up those APIs are painless in almost any language that has something similar to JAX-RS/Flask/etc
> A language known for abysmal performance
False, an implementation known for abysmal performance, which is CPython.
Re:I got tired of waiting (Score:4, Insightful)
Re:I got tired of waiting (Score:2)
It lulls you into a false sense of security by not throwing errors or warnings with its ultra-lax dynamic typing.
Unless you do like me and decide early on to convert warnings to ErrorException [php.net]. Sure, there are a few wrinkles, such as the fact that the string '0' is falsey, the fact that comparison operators tend to cast strings to integer, and the inconsistent naming of much of the standard library. But PHP 5.4 and 5.5 have cleaned up the language itself somewhat. One problem is that a lot of shared web hosting providers still deploy outdated PHP versions.
Re:I got tired of waiting (Score:2)
There are others like it but this one is mine. (Score:2)
Made me smile, to see the Rifleman's Creed [wikipedia.org] adapted for new purposes.
This is my good code / This is my bug
One is for running / One makes me shrug.
Re:I got tired of waiting (Score:2)
I've never seen language that remains consistent across versions
You must have missed Perl. It's remained remarkably consistent across major release versions when compared to many other languages, including Java and Python.
Some of the best features of Python are often called out as inconsistencies or syntactic sugar by people who don't really understand them (e.g. list comprehensions).
Backward incompatibilities [curiousefficiency.org] are very real issues affecting a very large amount of code.
Web is inherently parallel (Score:2)
Re:Reinventing the wheel (Score:5, Informative)
Why not use Node.js that has already got the wheel (JIT) rather than drilling holes in PHP to fit an axle?
Because PHP also has a perfectly good chassis, body, roof, steering wheel, gear shift, seats, windows, instruments, cup holders, audio, fluffy dice etc. that you know how to use and don't want to throw away.
People don't use PHP for the language (which is fugly), they use it because it has a huge collection of useful libraries, supported and well documented on the php.net site - and it is almost certainly available on your web hosting service.
Not knocking Node.js, but it is still "getting there" as far as mature library support goes: yes, there are plenty of modules, but you're still more likely to find 4 diverse, half-written modules for a particular function than one complete, well-documented, future-proof choice.
It can also be overly complex: Node's USP is asynchronous, event-driven programming, which is cool, but harder and overkill for many applications. Then there's the small matter of having to effectively roll your own web server for even the simplest dynamic web page (OK, you'll probably use a third party module - pick one and hope it stands the test of time, then learn how to configure it) and you'll still probably need a black belt in Apache to set up a reverse proxy to your app.
Mind you, the great thing about Node vs. PHP is that nobody ever has anything bad to say about Javascript as a programming language </sarcasm>
Re:Reinventing the wheel (Score:2)
why use node.js when you can use Java
Re:Reinventing the wheel (Score:2)
I'd take node.js over php any day of the week. also over python. practically over anything that doesn't have true threads really since that's the thing that makes node messy for some use. for everything else it's pretty damn neat.
)unless you just take a boilerplate "kit" of software for creating a website and end up with 20 different libraries and something that goes through 10 libraries for http reply... but only a php idiot would go that way(spoiler: many node projects end up that way).
Re:PHP: The Good Parts (Score:2)
I was tasked to find a framework for our development team to work. I tried 1/2 a dozen frameworks spending a couple days each. Ones I tried were Zend, Yii, CodeIgnitor, Symfony 2, Larval and one other that I can't remember at the moment.
Out of those I narrowed it down to Yii and Symfony. I then spent another couple days cloning one of our small projects in both frameworks to see which ended up being a better code base. I showed both projects to the team and said developing I found Symfony more complicated to get up and running, however once I did I found it much more enjoyable to use than Yii. I also presented a pro and con list that I came up with after using each for a week and presented that as welel.
Every other developer agreed and we have been using Symfony since. Symfony actually almost makes it hard to write bad code. And makes you go out of your way to actually write SQL injection code. The documentation is also fantastic which I find a lot of the other frameworks lacking severely with. We do not regret going with Symfony. The only thing we have an issue is with batch processing which I cannot using the ORM component since it cannot handle tens of thousands of objects quickly
Re:PHP: The Good Parts (Score:2)
Can you share the pros and cons?
Re:PHP: The Good Parts (Score:2)
I lost the list, but off the top of my head the pros and cons were more based off of personal coding style than anything else. But a few things I found better with Symfony was namespacing(Yii didn't have any), the majority of the components being modular so you can pick and choose what you want, the OOP was a lot better (Yii was actually doing eval in some of their base components), Yii was using ActiveRecord. I had others but can't remember them anymore... I only played with each for about a week when I came up with my list so it is far from exhaustive.
Re:Ad injection question (Score:2)
I've seen some ads at the bottom of the page even with ads disabled. I think Dice is just working on the big fuck you to disabling ads.
Re:Tidy it up !!! (Score:2)
purely out f curiosity: Since Java and .Net both have gone through significant changes, did they look just as tatty in earlier revisions compared to now?
(e.g. Java 1.0, 1.1)