125 Comments
- inactive, on 10/12/2007, -6/+43I think he's blind too - half the "broken" web is written in PHP already.
- noodlez, on 10/12/2007, -1/+24(i already kinda said this below but i'm repeating it here)
the cure isn't php. the cure is smarter, better developers.
these developers could use any language, as long as they're using it correctly and smartly. programming languages are tools to be used, not solutions in and of themselves.
script kiddies and inexperienced/careless developers (like people who don't even patch a sql injection on login forms) are the ones ruining the web - wildleaf, on 10/12/2007, -1/+18PHP is the cure if used correctly. So is just about any other language that is used on the web. I think the main point is that more recent versions of PHP have made it easier and more effective to filter user content and interact with "broken" browsers, etc. More power for the back end developer to control the final user experience. He is right.
- carguy84, on 10/12/2007, -6/+16I don't think it's ever ok.
- cuwickliffe, on 10/12/2007, -2/+11A language in itself isn't a cure. People using it properly is. I've seen some very bad implementations of PHP on pages. Seems to me that PHP isn't the solution or problem. It's people.Of course Lerhdorf's excessive use of "stupidity" says something too.
- iamcam, on 10/12/2007, -0/+8Except MySQL will use an existing link if another connection is attempted with the same connection parameters.
From the php manual ( http://us3.php.net/manual/en/function.mysql-connect.php ):
"If a second call is made to mysql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned. The new_link parameter modifies this behavior and makes mysql_connect() always open a new link, even if mysql_connect() was called before with the same parameters."
So it's probably more a function of heavy traffic on a server not configured for it. I've seen this problem on clients' sites using shared hosting because others on the same server received a LOT more traffic than my clients who probably only receive up to a few thousand hits per month. - Yrlec, on 10/12/2007, -2/+10And he's out on very thin ice when he's accusing other products of handling character-encodings badly. The fact that PHP doesn't properly support UTF-8 is one of the biggest flaws of PHP IMHO.
- JimV, on 10/12/2007, -1/+9When it comes to web developement, I think we all need to get back to the "picture at the top of the page, text at the bottom, and midi in the background" model for websites.
And more animated gifs! - senfo, on 10/12/2007, -1/+8Not as foolish as spewing out a load of crap as if it were true.
- inactive, on 10/12/2007, -0/+7I use PHP on a daily basis, and it's a damn fine and handy tool, like Perl. Also like Perl, it is not particularly elegant. Even if I use it and swear by it, like C, you will never catch me praising it for it's fine qualities. PHP is the power tool you pick up after you put on your overalls and just before you hit the I-beams. It can be used or misused, resulting in it's being a blessing or a curse.
That being said, the web has been broken since it began, by making the first attempt of HTML be so miserably short-sighted, we've had to graft parts of other little toy fractions of languages onto it ever since. If we had it to do over again, we should have combined HTML, XML, Javascript, and especially CSS all into one language with one united syntax and quit playing around with having to use ten different languages to write 20 lines of web page. That is why the web is broken, and adding another tiny specialized language just keeps making it worse. At least PHP can do enough that I can use it in more places. - Snuffkin, on 10/12/2007, -2/+9@noodlez
Oh, hooray. Let's confuse a LANGUAGE with a FRAMEWORK. - jbsnyder, on 10/12/2007, -1/+7You sir, are an ass, and an ill-informed one at that.
- CraigJ, on 10/12/2007, -2/+8uh, no. a single, specific tool for creating Web apps will not fix the Web, and anyway, I don't think the Web is all that broken.
- TokenUser, on 10/12/2007, -0/+5The problem is all the "Become an expert web designer" websites that teach you how to hack a template, with no understanding of how the backend servers work, databases, page/cache optimisation, etc.
The cure is SOFTWARE ENGINEERS with Usability and Design skills. PHP is a tool, not a solution. A proper engineer will pick the correct tool for the job, rather than shoehorning a solution into what they read in their "Web 2.0 tool of the week" newsletter. - gharding, on 10/12/2007, -2/+7name_spaces_are_for_chumps();
- hackershandbook, on 10/12/2007, -0/+5the web is broken - use php
from the creator of php
what a surprise!!! - waterandfood, on 10/12/2007, -1/+6It appears you did not read the article as if you have you'd see nobody is full of themselves here. If you feel the web is not broken then you're in trouble. He simply explained that and how PHP can help solve it. Talking about PHP seems to make sense at a PHP Conference, right? And he does talk about developers being the fix, not just a language having ini_set('fix_the_web', true); on by default.
- stormwater, on 10/12/2007, -0/+5yahoo.com would like a word with you...
- mikesol, on 10/12/2007, -0/+5Do you have some sort of problem with your H key?
- Foxphoto, on 10/12/2007, -6/+10PHP the cure? last i checked PHP has been around for quite a while.
- d3ik, on 10/12/2007, -4/+8To paraphrase Homer Simpson:
"Ah, PHP. The cause of, and solution to, all of the problems on the web." - GTPilot, on 10/12/2007, -0/+4i tried to build a fence once but it caused more problems than it solved.
maybe if i would have learned how to use my tools and build it better, i would have had a different story. - ninjasquirrel, on 10/12/2007, -1/+5It's just as easy to write insecure code in a strongly typed language. Good coding practices, not language selection, determines security.
Diggdisc: go away. - Grayslin, on 10/12/2007, -0/+4This article is very easy to take out of context. Rasmus Lerhdorf is not speaking about the entire Internet or other programming languages. This was a speech he made at the PHP|Works conference and was directed solely at PHP developers about PHP code.
He is in no way saying PHP is a cure all for anything, He is saying PHP is the cure for the broken web caused by bad PHP developers. His whole speech was about PHP developers learning to use their tools effectively and in a manner consistent with common sense and a little fore thought.
in many ways he is right in his speech, but as with all things there is "always another way" you must take his words with a grain of salt and realize this is the best approach for him and his development style. - eddieroger, on 10/12/2007, -0/+4Which languages automatically check for this? Just so those of us stuck using PHP in the dark ages can be turned on to the light.
- etnu, on 10/12/2007, -0/+4He's referring to output encodings, which I completely agree with.
With regards to the application code itself, it's actually kind of surprising how rarely a completely internationalized application has to worry about most of the things. 9 times out of 10 you're just passing byte arrays ("strings") without modifying them, and that works perfectly fine as long as you set the encoding on the page properly.
mb_string serves reasonably well for handling the cases where you need to get actual string character lengths (not byte lengths) and such, though I personally can't wait until strings support this stuff transparently in php6. - Robotsu, on 10/12/2007, -0/+4This coming from the language that left Register Globals on. I've been a PHP programmer for a few years and I love the language, but come on. Nobody has the right to be unduly pretentious, which is how he came off IMHO :P. Still, it's great to hear of the optimization improvements, and I can't wait to get them implimented
- noodlez, on 10/12/2007, -1/+5@Snuffkin
don't point fingers at me. he requested a langauge that automatically generates checks. no langauges, in and of themselves, automatically generate code. it requires something else backing the language up. - funka7ron, on 10/12/2007, -0/+3This is pretty similar to the talk he gave at OSCON. Here are the slides for the version in Toronto, tho:
http://talks.php.net/show/torkey06 - inactive, on 10/12/2007, -0/+3I saw nothing in this article that is a revelation that PHP can fix the currently "broken" web.
This article really didn't provide any useful information. For example:
"With some PHP commonsense, a few of the reasons why IE is broken can be overcome.
When it comes to Character Set detection, Lerdorf advises developers to always make sure that they actually specify a default charset in their PHP applications. "
So are we to assume (incorrectly) that you can't specify a "default charset" in languages other than PHP?
I love PHP because it's open, free, and available on just about any platform out there, but this article doesn't provide anyone with anything useful from what I can see. - noodlez, on 10/12/2007, -2/+5indeed.
the cure isn't php, its smarter, better developers.
these smarter, better developers could use anything from javascript to php to rails. - Mrkamikaze, on 10/12/2007, -3/+6Perhaps he should cure the Syntax problems in PHP before making such grand anouncements.
- gothfox, on 10/12/2007, -0/+3The funniest thing is that PHP is like an epitome of bad programming language design. It is inconsistent, full of crazy hacks (magical quotes instead of proper SQL parameter handling, anyone?), et cetera, et cetera. This guy should be the last one talking about the broken web, as he helped create a huge part of the problem himself.
- leighhalliday, on 10/12/2007, -1/+4Oooo. Either you messed up and mixed a variable and a function call together (I will let the missing ; slide), or you made a pretty nifty little variable/dynamic function call.
- alienz, on 10/12/2007, -0/+3One doesn't hand a bad carpenter a new hammer and expect them to build a better house.
Just as a good worker would never blame his tools for a poor result. - inactive, on 10/12/2007, -0/+3I understand how padlocks work, but if I need to break into one that doesn't make it any easy to hack in two...
Classic FUD reasoning. "It's open source, therefore less secure." And *how* is that? - bloodylip, on 10/12/2007, -2/+5And in most cases, those MySQL connection errors are caused by inexperienced/careless developers who don't bother checking existing connections before opening a new one. So a few users visit the site, and all of the sudden there are several hundred connections opened simultaneously.
- inactive, on 10/12/2007, -0/+3Wow, what a foreign concept in post-Donald Norman Internet, where nobody is responsible for anything at all except for the people who developed the tool, who take all of the blame for everything.
Be sure to pop up the next time you see one of our "I use Photoshop so that makes me a great artist!" trolls. I could use a meat shield while I reload. - inactive, on 10/12/2007, -0/+3(and (you-should(try(lisp)))(never (you-will (complain-about)("hitting the same key again"))))
- dtfinch, on 10/12/2007, -0/+3$php is a powerful $language, but my $ key is wearing $out.
- covertbadger, on 10/12/2007, -0/+3@diggdisc
What you mostly seem to be arguing is that large-scale enterprises seem to be staffed entirely by halfassed journeyman developers that cannot choose appropriate variable names or write decent comments. That's all well and good, and explains why most large corporations are lumbering dinosaurs when it comes to IT. Where I work (about 1000 employees, roughly 500 in the engineering dept), if you had a variable called $file and it was anything other than a file handle, it would fail the code review and would not be allowed to be committed to the source tree.
The bulk of our code is indeed written in java, but we did not choose java because we needed static typing as a crutch for incompetent developers. If this is the best reason you have for not using dynamic languages, then you deserve every day of tedious corporate development you are subjected to. - kelyar, on 10/12/2007, -0/+3what about perl and its "tainted" mode?
- transeunte, on 10/12/2007, -0/+2diggdisc, I would like to offer to you a bowl of STFU.
- covertbadger, on 10/12/2007, -0/+2@diggdisc
"In my real world, I sometimes don't have control of the code I inherit and have to integrate into a larger scheme."
That's fine. I never claimed everyone would be able to do what we do - I'm not in the habit of making blanket statements. I was taking issue with your claim that "it would be foolish to use [a dynamic language] in the real business world for an enterprise application". My experience proves that it can be done, and there are plenty of other people out there who also have this experience. Your experience merely proves you have not worked in a team that can do this.
"Now you have had success where you have been openly sharing code in python and regularly meeting for reviews. What happens when you inherit code from another project where you were not in the code reviews? It is far easier task to understand a static language than to grasp some shared dynamic typed library, unless they wrote lots of documentation to make your life easy, not always an option."
If we inherit sloppy code, then the fact that it is sloppy is reflected in the longer dev estimates, and the reason for the long estimates is made clear at a project management level. No team wants to be responsible for another team's important project going amber or red. Plus, you are ignoring what I said about code reviews and documentation being part of a project's deliverables. We are unlikely to inherit sloppy code from another team, because if it wasn't up to scratch it would not pass QA.
"It's also no suprise to me that 90% of your code is static typed, just like the in the real world. There is a reason for this I suspect."
Again, you clearly aren't reading my comments. Much of our server-side code is in java because at the time the core technology was designed (about 3 years ago), java had far superior libraries and frameworks for what we wanted to do. Furthermore, we do tricks with optimised java compilers to squeeze far more speed out of it than we could with something like python (important when your website has peak rates of 1m pageviews per minute). We picked C# because we found it better suited to writing high performance desktop apps than something like python. We certainly had our reasons for picking our technologies, and static typing is not one of them.
"I also suspect your world isn't quite as rosy you describe where everything is done according to conevntions, screw the timelines."
Once again, read my comments. If a timeline is set in stone and we have to cut corners, a maintenance release is scheduled for immediately after going live. The purpose of the maintenance release is to finish off any documentation. This is basic project management, and once again I would not work in an environment where this sort of stuff is simply let slip. - covertbadger, on 10/12/2007, -0/+2@diggdisc
I have plenty of experience of the 'real world' example you give, since I am actually the lead developer in the internal apps development team (10 devs, 5 QA) at my company. Whilst we have numerous skunkworks projects laying around which people hack on in quiet periods, nothing gets released into a production environment without a formal QA process and detailed code review.
Whilst the company's main project is written mostly in java, my team is about 40/50/10 java/C#/python. We've written 50,000 line python applications, sharing code amongst our own team and other dev teams in the department, and not had the problems you describe because we perform regular code reviews and our project deliverables include generated docs (ndoc etc).
I say again, if you are working in a professional team that does not take shortcuts, working with dynamic languages is not a problem. Your project manager should not be wielding deadlines as a way to get you to skip writing docs, and if the deadline is unavoidable then a maintenance release should be scheduled for immediately after delivery so that you get a window to keep things up to date. I wouldn't work in an environment where the sort of problems you describe are regular occurrences. - 2Wrongs, on 10/12/2007, -0/+2I realize this is a obvious troll (and you're not a developer), but I'll bite:
http://www.yahoo.com
http://wikipedia.org
http://www.digg.com
The horse has already been beaten about quality of developers (or lack thereof).
edit(Wow, you guys type faster than I do) - inactive, on 10/12/2007, -0/+2Disclaimer: I am not affiliated with diggdisc, author of comment below.
Just to make it clear, I neither agree nor disagree with TFA, just saying that yes, PHP can be helpful, but isn't a magic bullet. Considering that whole blog systems are writen in PHP exclusively, I wouldn't call it a tool for "small quick" jobs. - zombo, on 10/12/2007, -0/+2PHP broke it, so PHP should bloody well fix it.
- withears, on 10/12/2007, -1/+3My internets are broken! Quick, call a plumber!
PHP = Programming Helps Pipes -
Show 51 - 100 of 123 discussions



What is Digg?
Check out the new & improved