IT Conversations: Rasmus Lerdorf - PHP

http://www.itconversations.com/shows/detail58.html

I’m still listening to IT ConversationsStve McConnell yesterday, and now Rasmus Lerdorf of PHP.

Rasmus explains how the first version of PHP would just recognize special tags and replace them with calls to C code. Then he started adding conditionals, and the parser got immensely more complicated, because he didn’t know about compiler theory. Then came along these guys from Israel saying “hey, we’ve just taken a college class in compiler theory, why don’t we write a proper parser and interpreter for PHP”, and they did. Now, it takes experience to apply theory to practice, and so they weren’t quite happy with the result, and redid it for the next version of PHP. And now, with PHP5, they’ve added “some” object-orientation to the language. But it still carries all the baggage, and it’s just not designed from the ground up to be anything, really.



What I realized listening to Rasmus explain the accidental story of PHP is this: When the web sprang into existence, it also created a new kind of software development, where the cost structure and risk structure is much different from the shrink-wrapped software business. Fast response to changes is also much higher on the agenda in the web world: When you’re running an online store, you want to be able to respond more quickly to changes in the market than the typical two-year release cycle for software.



The response to the challenges of the “old” world of software was compiled languages, particularly C and C++. The response to the new world is interpreted scripting languages like Perl and PHP.



The depressing fact is that, while C and C++ are proper, designed languages, at least PHP, according to Rasmus himself, wasn’t even intended to be a programming language. Decades of experience with language design has been ignored. PHP has added all those things over the years, and PHP5 “behaves as if it was object-oriented”, whatever that means, according to Rasmus.



I think the “scripting” (or Agile) way of developing (or growing) a large class of software (operating systems, computer language interpreters, and space shuttle control software not included) is the right one. It’s not to be snickered at in any way. It’s simply the most appropriate tool and approach for the job.



So it would seem that what we need is a proper programming language to do this. One that has been designed as carefully as C#, from the ground up, to incorporate the best of modern langauge design, including obviously object-orientation and garbage-collection, and it needs to be a fully dynamic, interpreted scripting language. After David’s demo Monday of Ruby and Rails, I’m starting to think that Ruby might actually be that language.



Why would professional software engineers work in accidental languages like Perl and PHP, when there are real languages out there that do the job. Python might be an equally suitable alternative.



As an aside, Java surely is not. It’s a static, compiled language, which is not what’s called for in the world of Agile web development. I would think that C# has the same limitation, though I’m not sure.

2 comments

Mark Aufflick

Perl's not quite so accidental Great article Lars. As someone now doing medium Perl development (like 60,000 lines per project) I would have to say that although Perl is accidental as an "Agile" language, it was grown by people who know very well about things like compiler theory. And although it is completely optional (as per The Perl Way), Perl's OO constructs are really very effective. I would have to say that Perl is now by far my most favourite language (and I know quite a few).
Read more
Read less
  Cancel
Branimir Dolicki

... or you could go straight to Lisp In his recent book <a href="http://paulgraham.com">Paul Graham</a> argues: <blockquote>If you look at these languages in order, Java, Perl, Python, Ruby, you'll notice an interesting pattern. At least, you notice this pattern if you are a Lisp hacker. Each one is progressively more like Lisp. Python copies even features that many Lisp hackers consider to be mistakes. And if you'd shown people Ruby in 1975 and described it as a dialect of Lisp with syntax, no one would have argued with you. Programming languages have almost caught up with 1958.</blockquote> You'll find an older version of this at <a href="http://paulgraham.com/icad.html ">http://paulgraham.com/icad.html</a> (the reference to Ruby was added later and included only in the book). <p> Also, in his <a href="http://paulgraham.com/lispfaq1.html">Lisp FAQ</a>: <blockquote> <b>I like Lisp but my company won't let me use it. What should I do?</b> <p> Try to get them to let you use Python. Often when your employer won't let you use Lisp it's because (whatever the official reason) the guy in charge of your department is afraid of the way Lisp source code looks. Python looks like an ordinary dumb language, but semantically it has a lot in common with Lisp, and has been getting closer to Lisp over time. <p> They might even let you use Ruby, which is even more Lisp-like. </blockquote>
Read more
Read less
  Cancel

Leave a comment