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: (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: (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:
Re: (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: (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: (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: (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 compone
Re: (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: (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: (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
Re: (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: (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: (Score:2)
(hi narcc)
Re: (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
Re: (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 a
Re: (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 e
Re: (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 explainin
Re: (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 co
Re: (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 completel
Re: (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: (Score:2)
can you even spell?
Re: (Score:3)
The PHP Hamer:
https://www.flickr.com/photos/... [flickr.com]
What about PHP on the JVM? (Score:2)
Re: (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: (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: (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
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: (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: (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: (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 demonstrab
Re: (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.
Re: (Score:2, Insightful)
Re: (Score:2)
Re: (Score:2)
Re: (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: (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: (Score:2)
Re: (Score:2)
Re: (Score:2)
PHP? (Score:2)
Is that thing still around? [eev.ee]
Re: (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: (Score:2)
A shame you've never given it a good fact-check. That site is just short of being complete nonsense.
Re: (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: (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: (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: (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: (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: (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: (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");
if (b < c) printf("b < c!\n");
if (c < a) printf("c
Re: (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 thin
Re: (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: (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: (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: (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: (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 d
Re: (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
Re: (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: (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: (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: (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: (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: (Score:2)
Re: (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 bo
Re: (Score:2)
You wanted speed and you moved to Python? :DDDDDDDD
Re: (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: (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: (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: (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: (Score:2)
why use node.js when you can use Java
Re: (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: (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
Re: (Score:2)
Can you share the pros and cons?
Re: (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 ca
Re: (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: (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)