×

Announcing: Slashdot Deals - Explore geek apps, games, gadgets and more. (what is this?)

Thank you!

We are sorry to see you leave - Beta is different and we value the time you took to try it out. Before you decide to go, please take a look at some value-adds for Beta and learn more about it. Thank you for reading Slashdot, and for making the site better!

PHP Next Generation

Soulskill posted about 7 months ago | from the looking-forward-to-php-deep-space-nine dept.

PHP 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.'"

Sorry! There are no comments related to the filter you selected.

I got tired of waiting (1, Insightful)

Anonymous Coward | about 7 months ago | (#47106277)

And moved to Python instead.

Re:I got tired of waiting (5, Interesting)

philip.paradis (2580427) | about 7 months ago | (#47106285)

I've mostly just stuck with Perl and Bash, and I'm still not sorry.

Re:I got tired of waiting (5, Insightful)

Stellian (673475) | about 7 months ago | (#47106613)

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 (-1)

Anonymous Coward | about 7 months ago | (#47106341)

The deprecated branch 2 or branch 3 with practically no libs?

Re: I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47106371)

Yes.

Re: I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47107463)

Heh, very funny.

Re:I got tired of waiting (0, Funny)

Anonymous Coward | about 7 months ago | (#47106347)

So from slow to slow, i get it now.

Re:I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47106387)

From inconsistent to consistent. From difficult to scale to easy to scale. From crappy web frameworks to excellent web frameworks with extensive built-in security features and a superb track record.

I used to like PHP just because I didn't know of any better alternatives at the time I started learning it.

Re:I got tired of waiting (4, Insightful)

narcc (412956) | about 7 months ago | (#47106473)

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 (0)

Anonymous Coward | about 7 months ago | (#47106539)

Python, you mean the language that doesn't necessarily facilitate true multi processor concurrency?

Re: I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47107087)

Nah, I mean a giant snake that constricts its prey and lives in the jungle.

No shit I meant python, idiot.

Re:I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47106619)

"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"."

The biggest player I know that uses Python is Google. But I think this is irrelevant nonetheless.

What would be your language of choice to replace PHP, narcc?

Re:I got tired of waiting (-1, Redundant)

Jesus_666 (702802) | about 7 months ago | (#47106625)

Python, the language with radix conversion functions so inconsistent it makes PHP look well-designed.

(PHP: base_convert() can convert from any base between to and 36 to any base between 2 and 36. Python: int() can convert from any base between 2 and 36 to base 10 but String.format() can only convert from base 10 to bases 2, 8 and 16. There are no other built-in conversion functions. Admittedly, converting to thoer bases is rare but they could've at least make it consistent in both directions.)

Re:I got tired of waiting (1)

Anonymous Coward | about 7 months ago | (#47106673)

That's it? The biggest problem with python is that they don't have an int to arbitrary base string conversion?
I could have understood if you complained about python getting slower when you use more threads on more than one CPU.
Or the fact that their list implementation sucks so much that dicts are faster.

Re:I got tired of waiting (1)

Jesus_666 (702802) | about 7 months ago | (#47106881)

No, that's one problem with Python. There are others like it but this one is mine. (Well, and a few others but most of the good ones were already mentioned.)

Re:I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47107291)

Still, saying that a missing string conversion function makes python as inconsistent as PHP is a bit disingenuous.
I'd give examples, but you can go read phpsadness yourself.

Re:I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47107331)

oh god no, whatever can we do!

Re:I got tired of waiting (0)

Anonymous Coward | about 7 months ago | (#47107453)

String.format() can only convert from base 10 to bases 2, 8 and 16. There are no other built-in conversion functions. Admittedly, converting to thoer bases is rare but they could've at least make it consistent

Yea, the horrors of needing a library function to perform some obscure conversion. Throw the language out, right now.

Re:I got tired of waiting (0)

Adam Jorgensen (1302989) | about 7 months ago | (#47106977)

I made the jump from PHP to Python years ago and I do not miss PHP.

PHP is certainly easier to get a web application up-and-running with if you know nothing but beyond that it's a mess of a language that makes maintaining a clean code-base far more effort than it should be. It's basically scripted C for the Internet and not in a good way.

Which is not to say Python is the holy grail. There are a lot of things I don't like about Python, including some of the ones you mentioned (Non-trivial whitespace still annoys me) but on the whole it's a better language than PHP and the amount of libraries and support available is good.

At the end of the day, I'd rather be writing web applications in Python than PHP.

Re:I got tired of waiting (1)

Anonymous Coward | about 7 months ago | (#47107039)

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.

Not sure what you mean by that. The "print" function always worked fine; if you don't like it use the "write" function. Lambda functions work too. I've never seen language that remains consistent across versions (how many times have I had to decide between Java Version 5, 6, or 7, and don't get started about class paths and Jar Hell).

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).

Re:I got tired of waiting (1)

philip.paradis (2580427) | about 7 months ago | (#47108025)

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.

Re:I got tired of waiting (0)

__keronin (3601667) | about 7 months ago | (#47106365)

what ?? python dev already start move to Go after 2->3 disaster

Re:I got tired of waiting (1)

citizenr (871508) | about 7 months ago | (#47107127)

You wanted speed and you moved to Python? :DDDDDDDD

If PHP was a horse in the prog language race (4, Funny)

Anonymous Coward | about 7 months ago | (#47106303)

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 (0, Funny)

Anonymous Coward | about 7 months ago | (#47106321)

My metaphor for describing PHP is just in line with the traditional "tools in a toolbox" one.

Although, a rather big difference with mines is PHP is more like a rotten dusty sandwich you forgot at the bottom under some tools, and you tried to hammer a nail with it.
That is PHP in a nutshell.

If Java was a fish (0)

Anonymous Coward | about 7 months ago | (#47106355)

Java would be a Flying Carp [discovermagazine.com] . Invasive, taking over and destroying every ecosystem it gets into.

PHP is more like a Bluegill; a good place to start (fishing or programming) but most people move on to better things.

Java is. . . (1)

smitty_one_each (243267) | about 7 months ago | (#47106475)

. . .what happens when bureaucrats and computer scientists procreate.

Re:If PHP was a horse in the prog language race (0)

Anonymous Coward | about 7 months ago | (#47106379)

Oh look, another "PHP sucks" post. We know already. Just don't use it. Works for me.

Re:If PHP was a horse in the prog language race (4, Insightful)

narcc (412956) | about 7 months ago | (#47106503)

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 (2, Informative)

Anonymous Coward | about 7 months ago | (#47106513)

I've seen the fractal article, and then I fact-checked it

Did you fact check [phpsadness.com] it using PHP [phpsadness.com] ?

Re:If PHP was a horse in the prog language race (4, Interesting)

Ash Vince (602485) | about 7 months ago | (#47107105)

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.

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 (0)

Anonymous Coward | about 7 months ago | (#47108293)

Re: ternary operator; You're correct that the sample on the PHP sadness web site rather sucks on the understandability front, but it's still a valid point.

There's this pattern I sometimes use in Perl. I think it's a decent, readable use of multiple ternary operators chained. It would probably fail in PHP. (And adding brackets would actually make this look worse.)

return
      $d ? "$d_txt${h_txt}temu" :
      $h ? "$h_txt${m_txt}temu" :
      $m ? "$m_txt${s_txt}temu" :
      "${s}s temu";

Re:If PHP was a horse in the prog language race (0)

Ubi_NL (313657) | about 7 months ago | (#47106585)

You mean like this one?
http://eev.ee/blog/2012/04/09/... [eev.ee]

Re:If PHP was a horse in the prog language race (1)

narcc (412956) | about 7 months ago | (#47106609)

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 (-1)

Anonymous Coward | about 7 months ago | (#47106689)

No.
Maybe you "fact checked" by reading the BS reply to that post that claims everything with PHP is fine.
Or maybe you read PHP sadness and decided that yes, PHP is a complete POS.

Re:If PHP was a horse in the prog language race (1)

Ubi_NL (313657) | about 7 months ago | (#47106943)

can you even spell?

Re:If PHP was a horse in the prog language race (0)

Anonymous Coward | about 7 months ago | (#47107581)

Agreed. I use PHP for at least half of my coding, and it has its niche. That niche isn't medium or large sized web apps. It's quick scripts and hacks, which is exactly what 80% of the web is.

You'd boil that horse down for glue (0)

smitty_one_each (243267) | about 7 months ago | (#47106465)

. . .and the users would be all: "What're we supposed to do with this snot?"

Re:If PHP was a horse in the prog language race (5, Funny)

smitty_one_each (243267) | about 7 months ago | (#47106471)

Now, in defense of PHP, I've been trying to compile Yesod, so that I can take it out for a spin. I update cabal, tell it to install, get enough compilation pages scrolling by to make GCC envious, and. . .it crashes.
PHP at least lets me set up a web site and get hacked.

Re:If PHP was a horse in the prog language race (2)

drinkypoo (153816) | about 7 months ago | (#47107507)

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 (1)

jellomizer (103300) | about 7 months ago | (#47106975)

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 (1)

Bigbutt (65939) | about 7 months ago | (#47107631)

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]

What about PHP on the JVM? (1)

monzie (729782) | about 7 months ago | (#47106309)

A quick google search points me to one interesting project - "jphpcompiler" - https://github.com/jphp-compil... [github.com] . PHP on the JVM would be interesting. By leveraging existing Java and other libraries which run on the JVM ( by virtue of running on the JVM ) , PHP could be an interesting choice in Java and/or JVM based frameworks like Play ( Clojure ) or Grails ( Groovy ) or Spring MVC.

Re:What about PHP on the JVM? (2, Funny)

Anonymous Coward | about 7 months ago | (#47106327)

Yes, that's just what the world needs: the rigorous code quality of PHP combined with the high performance and lightweight Java Virtual Machine.

Any chance you could throw some Haskell and M4 macros in there, too?

Re:What about PHP on the JVM? (5, Funny)

baldass_newbie (136609) | about 7 months ago | (#47106481)

"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? (1)

smitty_one_each (243267) | about 7 months ago | (#47106483)

That project's going nowhere without an Emacs major mode and a slew of eLisp.

Re:What about PHP on the JVM? (0)

Anonymous Coward | about 7 months ago | (#47106385)

I think I just threw up in my mouth a little...

Re:What about PHP on the JVM? (3, Interesting)

binarylarry (1338699) | about 7 months ago | (#47106769)

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.

Re:What about PHP on the JVM? (1)

Rufty (37223) | about 7 months ago | (#47106825)

There's Quercus [caucho.com] a java implementation of PHP. Saw it, bookmarked it, never done anything with it.

PHP: The Good Parts (1)

Anonymous Coward | about 7 months ago | (#47106317)

https://twitter.com/i_error/status/471584795987021824

Re:PHP: The Good Parts (1)

Aethedor (973725) | about 7 months ago | (#47106501)

A very good part: Banshee PHP framework [banshee-php.org] .

I know this post will be flagged as spam. But if you like PHP, I challenge you to give this framework a try. At least take a look at the online demo [banshee-php.org] .

Tidy it up !!! (1)

Anonymous Coward | about 7 months ago | (#47106319)

Dear php developers. Please tidy up the namespaces and introduce consistency to your naming of functions etc. Pick some rules and STICK TO THEM.

The current code base is a mess and looks really tatty when compared to .Net, Java etc. !

Thanks.

PHP-slashdot (1)

Anonymous Coward | about 7 months ago | (#47106337)

It's so fun reading anything related to PHP in Slashdot as the discussion resamples the late "fuck beta" postings. Full of hate and anger, usually from people who don't even use it (as they use any other language but PHP because they're better).

Re:PHP-slashdot (0)

Anonymous Coward | about 7 months ago | (#47106367)

Don't things always progress, if they were not to, what could possibly happen?

I'd rather code COBOL or FORTRAN (3, Insightful)

msobkow (48369) | about 7 months ago | (#47106361)

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 (1)

Anonymous Coward | about 7 months ago | (#47106381)

Classic ASP is pretty awful, too.

Re:I'd rather code COBOL or FORTRAN (5, Funny)

Anonymous Coward | about 7 months ago | (#47106417)

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 (5, Insightful)

JaredOfEuropa (526365) | about 7 months ago | (#47107525)

PHP is great for prototyping, throwaway scripts, or other quick & dirty stuff. But if any of that kind of code makes it into a critical production environment and turns it into a maintenance nightmare, blame the manager who allowed or ordered that, not the language.

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 (0)

narcc (412956) | about 7 months ago | (#47106543)

It is, bar none, THE WORST LANGUAGE I have ever used.

I take it you haven't used many languages. It's far from the worst. Ever use Python? Blech!

the humungous amount of copy-paste code that PHP requires

What? You should probably elaborate here, as no "copy-paste code" is required.

I've had the misery of suffering with maintaining a few PHP applications over the years.

Ah, I see. You think the language sucks because your only exposure to it is a messy code-base you inherited. Can you direct me to the magical language that does not allow developers to produce a nasty mess that's difficult to maintain?

Re:I'd rather code COBOL or FORTRAN (0)

Anonymous Coward | about 7 months ago | (#47106741)

Oh here's widdle narrcy warrcy again with his rah rah PHP support.

Dude, give it up. Nobody wants your immature piece of shit language. You know, the jizz gargling hunk of junk that didn't even have real object support until V5, the one that makes a clusterfuck of something as simple as a namespace. I could go on.

Perl, Ruby, Python, they all put PHPs dick in the dirt, full stop.. it's the 'PHP in 24 hours' types like you that keep it going (and keep things exploitable LMAO).

Re:I'd rather code COBOL or FORTRAN (1)

Anonymous Coward | about 7 months ago | (#47106805)

Sorry, did you just compare PHP to Python and make the claim that Python is more disgusting than PHP? I'm not a fan of Python (self self.self self? self self) but at least it's sane.

You think the language sucks because your only exposure to it is a messy code-base you inherited.

Or maybe it's because PHP really does suck the big hard one [phpsadness.com] ? Who knows? Total mystery.

Re:I'd rather code COBOL or FORTRAN (0)

Anonymous Coward | about 7 months ago | (#47106813)

Can you direct me to a language other than PHP that manages to make the ternary operator useless?

Re:I'd rather code COBOL or FORTRAN (3, Insightful)

caseih (160668) | about 7 months ago | (#47107381)

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.

Re:I'd rather code COBOL or FORTRAN (0)

Anonymous Coward | about 7 months ago | (#47106831)

The PHP community must be immensely impressed by your fine and intelligent arguments instead of just shouting that something SUCKS.

Oh.

Re:I'd rather code COBOL or FORTRAN (0)

Anonymous Coward | about 7 months ago | (#47107019)

"The PHP community" is the worst part of PHP and a good argument against it.

PHP user: "Guys, I've found a bug in PHP here..."
PHP community: "It's an edge case no one will ever encounter! It's not a bug!
PHP devs: (edit PHP docs to say "Note: using this function on the last day of month can lead to arbitrary code execution")
PHP community: "See! It's documented! It's not a bug!"

Or:
PHP user: "It'd be nice to have this common feature..." (try/finally, say. Or not having to google T_PAAMAYIM_NEKUDOTAYIM when error message could say "unexpected '::'")
PHP community: "Who needs this? W3School never mentioned this, what is this anyways?"
PHP dev: "Agreed. Completely unnecessary, don't waste our time. Also here's a clunky work-around that incorrectly implements half of this feature"
PHP contributor: "Umm, here's a 5 line patch to implement this..."
PHP dev: "Yes, yes, this is exactly what I wanted to do, but did know how!.. Not that I couldn't do it if I wasn't so busy documenting bugs^Wmisfeatures"

And it's not just core language - for example, here's a crypto library [leaseweblabs.com] which thinks that a complete security failure only warrants a quiet warning.

Re:I'd rather code COBOL or FORTRAN (2, Insightful)

Anonymous Coward | about 7 months ago | (#47107073)

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.

Until NSA... (0)

Anonymous Coward | about 7 months ago | (#47106423)

...gets their interns or 3rd parties in the PHP dev team, I have no reason to use it.

Reinventing the wheel (0)

Ajay Anand (2838487) | about 7 months ago | (#47106487)

Why not use Node.js that has already got the wheel (JIT) rather than drilling holes in PHP to fit an axle?

Re:Reinventing the wheel (0)

Anonymous Coward | about 7 months ago | (#47106587)

No, nodejs isn't the answer to everything!

Re:Reinventing the wheel (5, Informative)

itsdapead (734413) | about 7 months ago | (#47106651)

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 (0)

Anonymous Coward | about 7 months ago | (#47106687)

>using javascript outside a webbrowser
I think long term exposure to toxic waste has damaged your mind. Only a complete moron would even consider node.js as a solution. It would take a monumental fuckup of a moron to actually use it.

Re:Reinventing the wheel (1)

gl4ss (559668) | about 7 months ago | (#47106867)

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:Reinventing the wheel (1)

El_Muerte_TDS (592157) | about 7 months ago | (#47106811)

why use node.js when you can use Java

Re:Reinventing the wheel (0)

Anonymous Coward | about 7 months ago | (#47107373)

Because you prefer when your application crashes, it gives you an error message instead of taking down all of tomcat.

This is why PHP continues to thrive (4, Interesting)

Qbertino (265505) | about 7 months ago | (#47106611)

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:
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 ... 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.

Anyway, I'm veering off. The point is:
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. ... 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?

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! (2)

Qbertino (265505) | about 7 months ago | (#47106647)

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 (0)

Anonymous Coward | about 7 months ago | (#47106701)

>this is why PHP continues to thrive
No. it came first and it, like html, attempts to keep on turning even in the face of errors instead of making the programmer fix their code. PHP programmers are shitty programmers. they do not want to have to fix their code. As long asit does something, they are happy. This is why PHPdriven sites are so epically insecure.

Re:This is why PHP continues to thrive (0)

Anonymous Coward | about 7 months ago | (#47107083)

Them checking the performance of Wordpress (...) 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.

Are you kidding us? How ELSE are you meant to improve performance, testing against ghosts? Look up history, we have Windows font rendering in the kernel because performance is more important than security!

And yes, that's a diss against both PHP and Wordpress as security catastrophes. While you think performance is critical, I can throw hardware at the problem to solve it, but I can't throw hardware to solve security problems if the language is a ticking bomb of uncertainity.

Re:This is why PHP continues to thrive (1)

wazzzup (172351) | about 7 months ago | (#47107239)

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 (0)

Anonymous Coward | about 7 months ago | (#47107473)

I think the biggest problem with PHP is the existing code written by non-coders. It is increadibly easy to write shitty PHP code, and hard to write good PHP code, but even harder to maintain shitty code. In a lot of cases it is easier to re-write a php program than to fix it. You could even call it a basic concept of PHP.

Re:This is why PHP continues to thrive (1)

drinkypoo (153816) | about 7 months ago | (#47107489)

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 (0)

Anonymous Coward | about 7 months ago | (#47107709)

You edit CMS templates for a living? How have you not shot yourself in the head yet. Yeesh.

This is why PHP continues to thrive (1, Redundant)

Qbertino (265505) | about 7 months ago | (#47106617)

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:
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 ... 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.

Anyway, I'm veering off. The point is:
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 Euros an hour. Being able to edit templates in the CMS Admin area isn't bad either. ... 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?

Bottom line:
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.

Well, I, for one, like it (1, Insightful)

Gaygirlie (1657131) | about 7 months ago | (#47106633)

Everyone is always bashing PHP even when they don't have any good reason for that, it's kind of like it's trendy to bash on World of Warcraft or stuff. Well, I happen to like PHP, I use it in my own stuff all the time. Sure, I don't use any of the more advanced features nor do I maintain a 50k+ codebase, but for my own use it's been great.

Re:Well, I, for one, like it (1)

jones_supa (887896) | about 7 months ago | (#47106719)

How large are your codebases then?

Re:Well, I, for one, like it (0)

Anonymous Coward | about 7 months ago | (#47106771)

Sure, I don't use any of the more advanced features nor do I maintain a 50k+ codebase, but for my own use it's been great.

You just answered your own question. PHP is an amateur's language. Some will rail 'but.. but.. but you can do professional code in any language!'.

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.

Re:Well, I, for one, like it (1)

Rufty (37223) | about 7 months ago | (#47106855)

The trouble with PHP is that the barrier to entry is so low that I've had to support production sites written by code monkeys that didn't understand the for loop.

Re:Well, I, for one, like it (0)

Anonymous Coward | about 7 months ago | (#47108063)

I don't code in PHP, but I've had to deal with managing multiple applications on a server. The thing that frustrated the hell out of me was the major incompatibilities between minor versions that weren't backwards-compatible. If I upgraded my server and the new distro used, say, version 5.3 instead of 5.1, it was inevitable that the PHP applications would break fundamentally. Then you either have to pester the application authors to fix it, or get into the mess of keeping multiple PHP versions around. It was always a pain in the ass, and I'm glad I don't have to do it any more.

Re:Well, I, for one, like it (1)

Powys (1274816) | about 7 months ago | (#47108179)

Everybody hates PHP, I get it. I don't. I understand all complaints to PHP, but I have learned to deal with them (I keep a php.net tab open so I can get the paramters in order). I currently maintian a PHP codebase that is just over 1 million lines of code. It is hosted on a cluster of servers that number about 30 (databases, sessions, application, static content, etc). The beautiy of PHP is the tight integration with Apache. When you do Apache right with PHP, you can make a website scale to no end (reverse proxy, load balancing, hot-standby, etc).

A budy of mine used to have this awesome quote: "It's not the language, it's the people". You can write shitty code in any language. You can write elegent code in any language. Shitty devs will write shitty code. It matters not what the language is.

Don't get me started on Node.js. It seems neat on the surface, but I'll be damned if I let my front end devs ever touch server side code. It is a completely different world with massivly differnet mind sets. It is dangerous to think you can unleash people well on both front and back sides of the coin.

Re:Well, I, for one, like it (0)

Anonymous Coward | about 7 months ago | (#47108243)

Sure, you can write shitty code in any language, but PHP actively helps you do so.

Re:Well, I, for one, like it (1)

Powys (1274816) | about 7 months ago | (#47108385)

I have no problem writing non-shitty code in PHP. I keep hearing that exact same line, but it doens't make any sense. If php actively makes you write bad code, I say javascript is worse.

Ad injection question (-1, Offtopic)

Assmasher (456699) | about 7 months ago | (#47106661)

Hey gang, I have ads disabled and yet I am still seeing a thin banner ad that closely resembles the footer banner ad that runs along the bottom if you re-enable ads.

I thought this was a chrome extension issue as many popular chrome extensions have had malware added to them recently, and when an extension I suspected as being the problem was disabled the ad disappeared, when re-enabled the ad re-appeared. I figured the problem was solved. This was on a dev box at work.

When I got home I checked out my home PC to see if the problem existed - and yes, it did. This time, however, disabling that same extension did not cause the ad to appear/disappear, the ad remained. So I disabled all extensions, and the ad remained. I scanned my machine with Malwarebytes Pro, ho hits. I then fired up Firefox (it has been a while) and updated it, then checked slashdot and replicated the same issue.

The ad looks exactly like a slashdot banner ad, seems to serve the same types of ads that a slashdot ad would, except that it is always just below the text of an article on the article's page - and ads are disabled.

Anybody else experiencing this?

Cheers

Why? Isn't there HHVM already! (1)

f00zbll (526151) | about 7 months ago | (#47106785)

I fail to see the point. Facebook already made HHVM and it's open source. http://hhvm.com/ [hhvm.com]
What do the gain out of it. Why not contribute to HHVM instead?

Re: Why? Isn't there HHVM already! (0)

Anonymous Coward | about 7 months ago | (#47107101)

Because HHVM isn't a drop-in replacement.

HHVM's existence is good for the PHP ecosystem if the rivalry motivates the PHP developers to keep improving the language and runtime.

PHP Upgrade? (1)

LifesABeach (234436) | about 7 months ago | (#47106835)

How about Multi-Threading? I use to be able to do it, now I can't seem to get it to work?! :/

with every improvement, more to loathe. (1)

nimbius (983462) | about 7 months ago | (#47106887)

PHP has always been to me the Ikea of programming languages. At some point its not a lamp, you've used up all the pegs for holes that take screws instead but still fit, and your wifes import lamp was done hours ago despite your best efforts.
And if more than 10 people in a room want to enjoy your lamp, the chain comes loose and your cat comes down with the squirts.

Re:with every improvement, more to loathe. (-1)

Anonymous Coward | about 7 months ago | (#47107735)

herpa derpa php hatred hivemind

^tubgirl (-1)

Anonymous Coward | about 7 months ago | (#47108019)

Contact to sse if dying. Everyone Are having trouble Talk to one of the They're gone Mac big picture. What
Load More Comments
Slashdot Login

Need an Account?

Forgot your password?