Why is PHP so popular? What can we learn from the PHP camp?

…and what can we learn from PHP’s rapid rise to success?

I’ve seen quite a few jobs which require PHP experience lately and I
wonder why; what’s PHP got that Ruby doesn’t? Sure, PHP is supposed to
make web programming quite easy, but don’t we have various Ruby
packages/modules/classes that are competitive in that arena? I’ll admit I
haven’t looked at PHP much, but from what I’ve seen of the language, it
doesn’t seem all that impressive.

Conversely, I haven’t seen any job listings which require Ruby skills
since last summer (the only one I’ve seen was for an Intel job last summer,
and from what I’ve heard they decided not to hire from the outside for that
position). I know that matz said at the RubyConf that it’s not important
to be popular; it’s important to be good (I’m paraphrasing here) and I
can understand that position, but some more popularity might help some of
us actually land jobs where we could get paid to use our Ruby skills.

So, what can we learn from the PHP camp? What have they done right in
promoting their language?

Phil

Visit: PHP: PHP Manual - Manual for starters. Ruby is no where near
that level of ‘extra’ functionality. Sure, it could be done… but it has yet
to be done.

Also…

PHP => high level of integration in Apache + high level of integration in
Linux == high level of integration in cheap hosting solutions (which is
the same as - it’s everywhere).

What you could do better than PHP is to go the Coldfusion route… and not
require delimiters that mark out specific sections of ‘processable’ code, as
well as store a ‘precompiled’ version of the source for quicker execution.

PHP ::

<? php code ?>

(evaluated everytime)

Coldfusion::

(evaluated only if source file has been changed since last compilation -
otherwise the compiled version is executed)

The deciding factor will be: is it already running on every ‘cheap’ to free
hosting provider?

-Rich

···

So, what can we learn from the PHP camp? What have they done right in
promoting their language?

Phil

[ snipping a fair number of good points ]

So, what can we learn from the PHP camp? What have they done right in
promoting their language?

They used it for everything, and they didn’t wait for a boss to tell
them it’s okay. And they worked on improving it at a manic pace over
the years. It’s not my first choice for most projects, but I have to
admit that the PHP community has responded to each disparaging comment
by improving the capabilities of the language.

Ruby is growing fast, that’s for sure. Other than that, the best way
to “promote” Ruby is just to use it.

Of course, that’s all very subjective opinion :wink:

  • Brian W
···

On Sunday, May 4, 2003, at 10:36 PM, Phil Tomson wrote:

My guess, PHP has a lot of the same syntax as C, most functions (of
extension libraries) even have the exact same name as their C version. I
think the learning curve for PHP is so much smaller then Ruby because of
this…

Regards,

Peter

I don’t know if PHP was actually first with the concept of “embedding code
directly in a HTML page”, but it certainly seems like that. You can get the
same functionality with Ruby + eRuby. However it seems PHP started with this
as its primary goal, starting with a very restricted language which slowly
became more general-purpose.
http://www.php.net/manual/en/history.php

Secondly, PHP comes with tight Apache integration out-of-the-box. (Ruby has
mod_ruby)

Thirdly, PHP is packaged together with all the libraries you might want,
which makes it simple to install and with a consistent set of features from
platform to platform. (ruby-sumo would be our equivalent I think)

So overall, I just think it was first in the market segment of “HTML hackers
who want to embed some code in their pages but who don’t know much about
programming”, which is a very large market. Ruby plays in that market too,
but IMO is much more general-purpose.

Perhaps another interesting question to ask is: why has PHP not taken off as
a general-purpose scripting language? I was asking one of my colleagues
about this: he writes web apps in PHP, but still uses perl for command-line
driven scripts. What is it about PHP which means you don’t use it for
command-line apps, I asked? He wasn’t able to answer really, or point to
anything in the language which made it unsuitable. Somehow it just didn’t
“feel right” to him to be using PHP outside of HTML!

Incidentally, I had a look at some of his PHP code, and it is written in a
very object-oriented style with lots of $this->dosomething(arg) calls. For
someone used to that horrible syntax, Ruby is an easy sell :slight_smile:
http://www.php.net/manual/en/language.oop.php

Regards,

Brian.

···

On Mon, May 05, 2003 at 02:36:21PM +0900, Phil Tomson wrote:

…and what can we learn from PHP’s rapid rise to success?

I’ve seen quite a few jobs which require PHP experience lately and I
wonder why; what’s PHP got that Ruby doesn’t?

Hello!

That’s easy!

(1) PHP were the first to get popular
(2) PHP comes with a huge library, and tightly integrated with Linux/Apache
(have anyone already heard about LAMP? Linux Apache MySQL and PHP).
(3) PHP manipulates databases just like anything else! This is much important
for web-programming
(4) They maintain a standard source for information (their on-line manual)

If we want, some day, to overpass Ruby firstly we should create a know-it-all
source for information (just like php manual). It’s easy to learn PHP since
either beginners or wizards always can refer to php manual since it have
everything.

Secondly, Ruby surely could group some of the most important libraries
provided by RAA into the main code. I do think modularity is a good thing,
but, to be successful in the web segment, a language should come with
everything that segment needs. This means that bundling Ruby/DBI together is
a must-do, for example.

And lastly, we should know other languages! Yes! Ruby is the best, but once
someone get hired for his php skill, one could easy enough start using Ruby
instead to do the same thing. Getting inside companies that use PHP mainly
and start a shift to ruby from there is the best way to break PHP hegemony.

s

Pablo

···

Em Seg 05 Mai 2003 02:36, Phil Tomson escreveu:

So, what can we learn from the PHP camp? What have they done right in
promoting their language?

Phil


Pablo Lorenzzoni (Spectra) spectra@debian.org
GnuPG Key ID 268A084D at search.keyserver.net
Webpage: http://people.debian.org/~spectra/

So, what can we learn from the PHP camp? What have they done right in
promoting their language?

Libraries and lots of full-featured, professional-grade apps.

I’ve tried to sell Ruby development to a good friend who has been putting up
assorted sites. He appreciates good language design, but appreciates even more
ease of job completion.

Want to add an RSS feed display to your site? There’s assorted PHP modules.
Want a calendar? Chat board? Mailing list manager? Online catalog with
credit-card processing? All available.

So, while PHP is, in many ways, hackish and ugly, it makes it easy to
accomplish certain specific tasks. PHP’s dark side is revealed when
you try to customize any of this stuff; most of what I’ve seen makes
poor use of whatever marginal OO features PHP might offer; poorly named
global variables are everywhere. Ruby is much much better
for any large scale web app dev, but at the moment it seems that
anyone looking for such stuff must start from scratch.

James

Reasons for success

1) PHP has huge and really good library.
   It's perfect for integrating other services and databases.

2) PHP has perfect documentation.
   For Ruby there is nothing like this. We don't have any written
   language reference. Buying the O'Reilly "Ruby in a Nutshell" was a
   waste of time and money, because this is not a reference.
   It does not even mention that a ! or ? following the identifier in a
   "def" belongs to the name, it doesn't contain a BNF Grammer or something
   like this.

3) PHP has good and easy to use tools for professional development.

4) PHP was designed to do one job and is great with this.
   Ruby is a general purpose language, that is good in a lot of places
   and unperfect in all.

5) Ruby don't have a good Web Tool. Amrita is okay, ERuby is okay, but
   if you enter the professional level they fail. For example
   streaming output into memory and postprocess the output in the same
   script (for PHP users: obstack)

6) Rubies OO functionallity is not so important in CGI like scripts
   (this means scripts that start with no internal variables other
   then session variables).
   This would only be an important point if you use an application
   server, but there is none.

7) PHP is available everywhere.

8) Everyone can learn PHP in a week, because it is much simpler
   Even designer and low paid students, which is commercially
   important.

9) There is not this Perlish like line noise (source code) you find in a lot
   of otherwise not documented ruby libraries (and in the standart library).

Just wanted to mention that in all the replies so far no one has
mentioned Java. Applications servers built on J2EE and running Servlets
are on the rise and fast. I admit that I have only looked at Servlets
for about a week but the benefits were clear to me.

o You have a full fledged OO programming language at your disposal

o Servlets stay in memory and can easily maintain state. Sessions.

o Speed on par with FastCGI. I think?

o Full JDBC connectivity.

o Application Server availability (Tomcat) i.e. it’s free.

I only brought this up is that if I had to choose between PHP and
servlets today I would go with servlets simply because I’ve done
PHP and I struggled with it. Why? At the time it wasn’t a “real”
programming language and all the apps I looked at seemed hackish.

Simply put. On the web development front there is more than PHP alone.

As far as why PHP was/is successful? Beginners like tutorials. If I
remember correctly this is what attracted the majority of HTML only
hackers which was a huge group of people. It was simply THE answer
for dynamic web sites.

Finally I must say that I personnaly believe that Ruby could do quite
well in the web development front, but it isn’t a new market. So
gaining market share is going to be very difficult.

Cheers,

Emiel

···

…and what can we learn from PHP’s rapid rise to success?


E F van de Laar
+31648183479
www.il.fontys.nl/~emiel

Good evening all,

My wish is for more hosting providers to support embedded-Ruby.  Being 

able to run Ruby CGI scripts is great, but being able to embed Ruby in
HTML would make it my number-one choice for web programming, bar none
(assuming the modules I need are there).

Does anyone know of a good hosting provider which supports eRuby?
  • Sean

(1) PHP were the first to get popular
(2) PHP comes with a huge library, and tightly integrated with Linux/Apache
(have anyone already heard about LAMP? Linux Apache MySQL and PHP).

The P also refers to Perl and Python; LAMR hasn’t the same ring.

(3) PHP manipulates databases just like anything else! This is much important
for web-programming
(4) They maintain a standard source for information (their on-line manual)

There’s the pick-axe book, and ruby-doc.org offers something akin to
php.net’s URL-based method look-up:

http://www.ruby-doc.org/find/pickaxe/string
http://www.ruby-doc.org/find/pickaxe/array

(Though I’m thinking now that that the base URL up to the search term
could be clearer or more intuitive.)

If we want, some day, to overpass Ruby firstly we should create a know-it-all
source for information (just like php manual). It’s easy to learn PHP since
either beginners or wizards always can refer to php manual since it have
everything.

A goal of the Ruby Documentation Project; volunteers welcome!

James

So, what can we learn from the PHP camp? What have they done right in
promoting their language?

Libraries and lots of full-featured, professional-grade apps.

I agree, James, even though many of them seem to be one-off variants of
one another - e.g. PHPNuke and its offspring. Every few revision cycles
or so, they cross-pollinate in an attempt to maintain feature parity.
[ On the otherhand, they all seem to suffer from a re-implementation of
the same issues, most notable security lapses. ]

I’ve tried to sell Ruby development to a good friend who has been
putting up assorted sites. He appreciates good language design, but
appreciates even more ease of job completion.

PHP does manage to make it easy to do simple things. The packages that
you mention help folks avoid getting bogged down in details when
attempting more sophisticated work, since many of them reduce some
problems to configuration (i.e., they aren’t just application
frameworks, but applications).

So, while PHP is, in many ways, hackish and ugly, it makes it easy to
accomplish certain specific tasks. PHP’s dark side is revealed when
you try to customize any of this stuff; most of what I’ve seen makes
poor use of whatever marginal OO features PHP might offer; poorly named
global variables are everywhere.

PHP certainly has problems when attempting to produce larger,
well-structured systems. The initial problems targetted by PHP (html
macros, cgi processing) were simple enough not to demand scalable
solutions. In PHP it is clear that OO has been added as an
afterthought, largely, I think, to help get around namespace issues,
rather than to provide other OO benefits.

Things to observer/learn from PHP?

  • Domain specific solutions can be very successful.

  • Focusing on specific problems leds to useful optimizations.

  • General solutions require great forethought (perfection) or a means to
    control disruption.

If we view PHP as a business, then it has found its niche and done well.
What is Ruby’s niche? The history of successful languages is filled
with general purpose languages that succeeded because they came to
dominate a domain. What should Ruby do better than any other language?

[ Suddenly, I’m reminded of a story about Larry Wall: someone complained
that Perl did not fit the *nix model of tool-like utility - do one thing
and do it well. Larry purportedly replied, ‘Perl does do one thing
well; it implements the Perl syntax.’ ]

Thanks for reading,
Jim G

···


James B. Greer jgreer@midsouth.rr.com [expires: 2004-12-27]
7F49 3D20 03C6 E859 E4F9 0735 E1F9 B259 21FA 1494

On Mon, 05 May 2003 14:46:31 +0900, Rich wrote something resembling:

PHP ::

<? php code ?>

(evaluated everytime)

Coldfusion::

the good thing about using processing instructions like php does:
<?php php code ?>
is that it’s easily classified in XML.

and about the caching used in coldfusion, it’s ‘easily’ reproducable in
php…look at projects such as smarty (http://smarty.php.net/) and so
on.

···


::: name: Nikolai Weibull :: aliases: pcp / lone-star :::
::: born: Chicago, IL USA :: loc atm: Gothenburg, Sweden :::
::: page: www.pcppopper.org :: fun atm: gf,lps,ruby,php,war3 :::
main(){printf(&linux[“\021%six\012\0”],(linux)[“have”]+“fun”-97);}

Visit: http://www.php.net/manual/en/ for starters. Ruby is no where near
that level of ‘extra’ functionality. Sure, it could be done… but it has yet
to be done.

···

----- Original Message -----
From: “Rich” rich@lithinos.com


Amen! I have a good friend who would not even consider switching from PHP
to Ruby, and this was his reason. Sure, we have the Pickaxe (which is
wonderful), but that’s not the point: Look at the range of modules
included in the standard distribution. In Ruby there may be a way to do X
(or several), mostly completed, partially documented, found in the RAA…
but in PHP there is a canonical way to do X, supported and documented as
thoroughly as String#reverse.

In other words, there’s a lot more in the language, supported, documented,
and with the PHP stamp-of-approval. (Which, considering the repeated gaping
security holes in PHP, doesn’t mean much to me! It is clearly an inferior
language in terms of design, but in the PHP crowd I don’t think that matters
much.)

Which hints to the other reason PHP is so popular: Marketing and cost. Why
is Taco Bell more popular than El Palenque (on SE 17th; check it out, Phil)?
Marketing and cost. (Since both Ruby and PHP are free, of course, “cost” in
that sense refers to difficulty of installation and learning curve.) PHP
was sold as a language for html-people… a programming language for
non-programmers. In fact, your old html pages already worked just fine as
"valid programs"!

Taco Bell doesn’t have to be good. It just has to be OK, cheap, and easy.

I think the “Taco Bell” argument is why it became popular, and the “big
manual” argument is why people stick with it. (Well, that and the fact that
a lot of people stick with their first languages.)

It’s surprising to me that “real” programmers would use PHP, though, even if
they have other scripting languages to use.

However, it really doesn’t make any difference to me how popular Taco Bell
is; It doesn’t make El Palenque any worse. Perhaps the difference is that I
don’t think anyone would disagree with me that El Palenque’s food tastes
better… especially people who had never gone there. (I presume none of
you have ever been there, but you believe me that it tastes better, don’t
you?) My Mexican food snobbery carries a certain weight, I suppose, and no
one who eats at Taco Bell is going to be snobby about their food. I think
everyone realizes that what Taco Bell does well is something other than
making the best Mexican food in the city, and few (if any) would claim it to
be the highest-quality Mexican food around.

I guess the problem is that most programmers see programming languages as
more like religions than Mexican food. If I told you I was writing a new
programming language, wouldn’t you have at least a bit of scepticism,
perhaps even contempt? “Why another?” “Do you really think it will be
popular?” And so on. But what if I told you I was opening a new Mexican
restaurant? “When does it open? Are you going to have free chips and
salsa?”

Anyway, happy Cinco de Mayo! :wink:

Chris

I actually think this is exactly the key.

Unlike most of you here, I don’t have huge pre-Ruby experiences with
programming languages. Sure, I coded in various Basic dialects in the
80s and very early 90s, picked up some Pascal around the same time,
but really, I never was what I would call more than a “causal hobby
programmer”. For instance, I never got into C, and yes, I tried a few
times throughout the 80s. Just wasn’t my thing: it didn’t “speak” to
me (or rather, I didn’t “speak it”).

My background is journalism (not in the English speaking area) and
community management/development, so I never needed to know any
prigramming languages. I did want to throw together my own quick
utilities/script for certain tasks when the available tools or
applications didn’t do the trick and I grew tired of having to find
someone to write them for me, so I frequently looked at newer
languages, hoping to some day find one that appeals to me. I
discovered Ruby about two years ago, found that the code bits I saw
“made sense” (to me, a non-programmer) and I decided that Ruby is
going to be “my tool”.

However, I didn’t know the basics, so I started to look for literature
– and found very little that was useful to me, a complete novice. I
spent many hours blankly looking at scripts written by others, reading
the same passages of the early chapters of the Pickaxe book numerous
times and slowly got the hint an idea. Ironically, those 15 years old
“Basic basics” did help with this, and of course, something like
string.include?(“foo”) is something even a non-programmer understands
simply by looking at it.

But all in all, I was still stumbling around blindly until I got my
hands on a copy of Mark Slagell’s “Teach Yourself Ruby in 21 Days”
(this title does the book great injustice). That changed things
drastically. I -understood- the way Mark explained things and he did
it gently enough to teach me the fundamentals – and got me started
with his book. Once I comprehended the basics, I also started to
understand a bit more of this newsgroup’s content (I have actually
read and achieved it faithfully every day for nearly two years, even
though there is still a lot of stuff that goes right over my head!),
and the Pickaxe became an actual resource rather than something I knew
was important but that didn’t help me much.

Many moons later, the situation is only slightly better. There finally
is an online tutorial, Daniel Carrera’s “Learning Ruby”, and the
Windows installer of Dave Thomas and Andy Hunt is a heavenly gift for
those of us who need someone to help us with the baby steps. I would
not be here today and would not use Ruby as an essential tool for
every day task’s if it wasn’t for this installer. However, compared to
what PHP offers to interested neophytes, these are drops of water on a
hot rock.

PHP is so popular that even kids at ages 14 or 15 pick up PHP basics
and use it for their personal web pages (whether or not they need it).
It’s uncommon to find a teenager on the web today who doesn’t know at
least some HTML, and the “logical next step” to them seems to be PHP
or Perl. Just yesterday I had a sixteen year old walk up to me and ask
if I could help with a Perl question. Hell, of course not! I mentioned
Ruby, and of course the kid never heard of it. A good friend of mine,
a writer, started to pick up Perl because “it seems useful” … and
while I know that she’d understand Ruby better, she isn’t interested
because it’s not popular and there is so very few easy-to-understand
Ruby resources available.

The point being … if someone wants to learn PHP or Perl, there are
literally dozens of beginner-friendly tutorials out there, and new
ones are written daily. There are plenty of starter books, countless
web sites. I’m talking about tutorials not only for people – like
most of you – who know at least one other language (and often more
than that, backed by sound IT/CS education), but the “average” person
who doesn’t know what a command line (thankfully, I was born early
enough to know what computers without GUI were/are like :wink: is and to
whom you have to explain what a variable and an array is (you know:
“an array is like a shopping bag, you can throw in different items,
take them out, replace them with another item, etc”).

If you want popularity, you need to provide more beginner-friendly
tutorials and doumentation. You probably also need more technical
material for the more advanced folks, those who come from other
languages. But I think Ruby will eventually reach those anyway, since
it convinces with quality. The “mass market” is another story
altogether. I’m not sure if that market is a target at all, but well,
PHPs popularity is at least partly based on its availability and
accessibility to/by “the average guys”.

By the way, the mswin32 port of 1.6.8. is still the version that’s
distributed as latest stable version – in the Windows One Click
Installer for example. There is a good chance that this will be the
version that curious average-people who happen to hear about Ruby will
find and download. Let’s just the say the IO of this version and this
port is not very thrilling. Processing a 280 MB text file (just very
simple regexp matching) took an embarassing 1097 seconds in 1.6.8. In
1.7.3 it was 53 seconds and 1.8.0p2 completed the job done in 34s.

Now, if I had tried to write/execute that script in 1.6.8, and it
would have been my first experience with Ruby, it would definitely
also have been my last experience with Ruby. (I read about these
problems here in the group back when they were first reported – but
the average person who “plays a bit” with Ruby won’t be reading
comp.lang.ruby or the list.) Perhaps this should be “fixed” or
replaced with a different version.

Anyway, I’m rambling! Sorry about that. :slight_smile: (Yes, my scripts are
appropriately elaborate too – working on that!) In summary, I think
tutorials and better documention are primary keys to success and
“popularity” … and with popularity comes the jobs.

-M.

···

On Mon, 5 May 2003 19:43:37 +0900, Pablo Lorenzzoni spectra@debian.org wrote:

If we want, some day, to overpass Ruby firstly we should create a know-it-all
source for information (just like php manual). It’s easy to learn PHP since
either beginners or wizards always can refer to php manual since it have
everything.

Yes, and we don’t have good tutorials to make a web portal.
So if I feel, that I don’t have support it (it might be available
somewhere, I might be stupid not to find it, it doesn’t matter)
This time I don’t feel I can gain being Ruby OO, if I don’t know how to
use it to eg. make a web portal… (yes, this tutorial is not
necesarily a ruby-specific one)

Gergo

···

On 0505, james_b@neurogami.com wrote:

So, while PHP is, in many ways, hackish and ugly, it makes it easy to
accomplish certain specific tasks. PHP’s dark side is revealed when
you try to customize any of this stuff; most of what I’ve seen makes
poor use of whatever marginal OO features PHP might offer; poorly named
global variables are everywhere. Ruby is much much better
for any large scale web app dev, but at the moment it seems that
anyone looking for such stuff must start from scratch.

±[ Kontra, Gergelykgergely@mcl.hu PhD student Room IB113 ]---------+
http://www.mcl.hu/~kgergely “Olyan langesz vagyok, hogy |
Mobil:(+36 20) 356 9656 ICQ: 175564914 poroltoval kellene jarnom” |
±- Magyar php mirror es magyar php dokumentacio: http://hu.php.net --+

  1. Ruby don’t have a good Web Tool. Amrita is okay, ERuby is okay, but
    if you enter the professional level they fail. For example
    streaming output into memory and postprocess the output in the same
    script (for PHP users: obstack)

StringIO? A pair of threads? IO.popen(‘-’)?

  1. Everyone can learn PHP in a week, because it is much simpler
    Even designer and low paid students, which is commercially
    important.

Not sure I agree there. It may start simpler, but there are many “ifs”
and “buts” on the way. I started to read up on PHP when I thought it might
be a Perl-done-right, but it soon became clear that it had at least as many
faults as Perl, so I gave up.

I will agree on the flaws of much Ruby documentation though. In many cases
the documentation is just “list the classes and the methods” which makes it
extremely difficult to work out what they are intended to do, and how to
start using them. The ‘csv’ library in RAA is a particularly poor example:
http://rrr.jin.gr.jp/doc/csv/

but there are many others like it. In my case I read ‘C’, I read Ruby source
fairly well, and am not averse to a bit of trial-and-error with irb.

Regards,

Brian.

···

On Tue, May 06, 2003 at 12:42:04AM +0900, Lothar Scholz wrote:

Reasons for success

  1. PHP has huge and really good library.
    It’s perfect for integrating other services and databases.

It’s also far easier to port a C-based library to another functional
language than it is to an object-oriented one: notice that the PHP
calling convention is much like the C one.

The standard library grew -really- fast in the last few years, something
Ruby can do too. The difference is that PHPs is ingrown, part of the
standard distribution, and all it takes to turn it on is install the
code it depends on for the function you need, and add --with-foo to the
configure commandline, and you get a dynamically loadable library for
PHP.

  1. PHP has perfect documentation.
    For Ruby there is nothing like this. We don’t have any written
    language reference. Buying the O’Reilly “Ruby in a Nutshell” was a
    waste of time and money, because this is not a reference.
    It does not even mention that a ! or ? following the identifier in a
    “def” belongs to the name, it doesn’t contain a BNF Grammer or something
    like this.

This is something that hindered me when I started to learn Ruby,
particularly before I realized that the language wasn’t out to surprise
me like PHP. (I learned Ruby as my nineteenth programming language, so
the lack of docs didn’t hinder me that much at the “Hello World” level,
but it would certainly help where I am now – I’ve had to delve into the
code to about half the modules I’ve used, since the code is complete and
the docs tend to lag…)

One other thing is that there are many, many resource sites out there
for Ruby, but they cross-link very little, and they all miss vital
pieces of information. I didn’t know about the Pickaxe book, I
suspected that O’Reilly had the Nutshell book, wasn’t sure if there was
a complimentary reference by them or not, found only one reference to
Matz’s book, and the language references I find online (Rubycentral and
the old 1.4 ref) all seem to be incomplete.

One thing PHP has that every other langauge doesn’t: It’s features are
documented on the web before they are released. The manual notes which
features are in the up-and-coming release from CVS, and what’s in each
released version, and it documents the differences, usually. This has
been a driving force in development. People download the new release
when it comes out – the features seem to come out as a post-beta,
because in everyone’s minds, it’s been out a while in the docs, anyway.

The other thing about PHP is that it is trivial to package. In the PLD
distribution (Which I highly reccomend, by the way), each PHP module is
a separate package, which contains a .so and a script to activate it in
the interpreter configuration, and restart apache if needed. mod_php is
just one file plus the .ini plus an http config shard. The command-line
interpreter is one file plus another .ini. Ease of packaging means
that distributions will carry more up-to-date versions of packages, and
more of them will carry it at all.

The dependencies are also isolated in PHP’s extensions – since they are
dynamically loaded, binary packages can suppport mysql, but if the user
does not have it nor it’s libraries installed, one can just omit mysql
support in PHP without recompiling.

Now, be aware that there’s also a “native” library of functions, the
PEAR. It is far less used than the C extensions, probably by an order
of magnitude because it was distributed as a second package, and few of
the linux distributions carry it. This has changed recently, so it’s
something to be aware of: how many distributions carry, and how many
PHP apps will depend on PEAR in the future, now that it’s bundled?

  1. PHP has good and easy to use tools for professional development.

Decent ones, anyway. It tends to be managable with a text editor more
than other languages. Ruby’s pretty good this way, too, and it’s easy
to /design/ tools for Ruby. This one I think will take care of itself,
more than it has for PHP.

  1. PHP was designed to do one job and is great with this. Ruby is a
    general purpose language, that is good in a lot of places and
    unperfect in all.

PHP is also buggier than a swamp in the midwest US.

It took two and a half years to make pass-by-reference not crash the
interpreter randomly. Memory usage is high for long running scripts
(it’s Garbage Collection is very poor).

PHP was less designed than just kludged together.

  1. Ruby don’t have a good Web Tool. Amrita is okay, ERuby is okay, but
    if you enter the professional level they fail. For example streaming
    output into memory and postprocess the output in the same script (for
    PHP users: obstack)

This is one way that Ruby could, with just a few new libraries, totally
destroy PHP.

PHP cannot make modular HTML easily. None of the application frameworks
make it easy to include another application or script’s output in a sane
way. I’ve written such a framework (as yet unreleased, though it’s
heavily used and the code is almost clean enough) – and the
modularisation is the biggest task to accomplish. In my case, I’m using
scripts that spit out basic but complete XHTML documents, and using XSL
to transform them into something one can just include in the output of
another module. I use XSL yet again to add style at the end. It’s a
messy, messy thing to do, because at it’s core, PHP is not Object
oriented.

Ruby could take over quite easily in the web-framework arena. Since
mod_ruby isn’t just a parse-this-file module, but instead an entry point
for an entire framework, Ruby can compete with Zope, and can be easier
to install. It also scales smaller than Zope, so it could go almost as
low as PHP’s my-HTML-is-valid-PHP approach.

  1. Rubies OO functionallity is not so important in CGI like scripts
    (this means scripts that start with no internal variables other then
    session variables). This would only be an important point if you use
    an application server, but there is none.

An application server would be a killer app.

  1. PHP is available everywhere.

This is partly due to “release often”, and partly that it’s easy to
package.

  1. Everyone can learn PHP in a week, because it is much simpler Even
    designer and low paid students, which is commercially important.

That’s just the docs – people plateau in PHP pretty quickly afterward.
Not many people who manage to use PHP+MySQL+Apache really understand
what’s going on – few learn relational database theory, few generate
valid HTML, but they manage to code simple but messy apps.

  1. There is not this Perlish like line noise (source code) you find in
    a lot of otherwise not documented ruby libraries (and in the standart
    library).

True.

Ruby also has one place where it shines: large application interfaces
where “object fronting” is useful – whether to hide a distributed
system behind a frontend, to simplify an API, to hide an ugly data
format based in XML. The ability to make such powerful proxy classes is
an asset that few other languages can manage.

Ruby has the potential to be an incredible glue language: now it just
needs language bindings for all the parts to glue together. Powerful
GUI libraries, and perhaps a standard abstraction for them, graphics
libraries (RubyMagick? Ruby-gd?), network libs (we have these), a web
app server, a generic app server, drb-based perhaps? Simple ways to
implement Model-View-Controller in both a web and a more gui-app
frontend with the same model would be very useful.

Building a ruby “Standard Library” of all this is, I think, the way to
go. A very bazaar approach would work, I think: let the “reigning”
module developers maintain their modules as part of the library – I
would love to see REXML included, along with Ruby-Mysql, Ruby-Postgres,
DBI would be a must, and at least one graphics processing library.

Aredridel

···

On Tue, May 06, 2003 at 12:42:04AM +0900, Lothar Scholz wrote:

I would disagree there - I have never seen any Java application which is
fast! :stuck_out_tongue:

Actually, all the Java apps I’ve seen have not only been slow but also buggy
as hell when put under load (‘under load’ sometimes means three
keystrokes) which gives me a rather negative impression overall.

Seems like you get the worst of all worlds with Java: slow execution speed,
the inconvenience of compilation, next to no type safety (see discussions
passim), and subtle dependencies on the exact version of Java VM as well
as on the underlying host OS.

There’s also the bloat. On my rather dated Vaio P266MMX laptop running
FreeBSD, Ruby builds in about 4 minutes. jdk-1.3.1p6_4 took over 3 hours.
Ruby plus its standard libraries takes under 4MB of disk space;
/usr/local/jdk1.3.1 is 64MB.

Oh, and it’s an encumbered technology - I had to agree to terms and
conditions before downloading it.

Regards,

Brian.

···

On Tue, May 06, 2003 at 04:52:56AM +0900, E F van de Laar wrote:

Just wanted to mention that in all the replies so far no one has
mentioned Java. Applications servers built on J2EE and running Servlets
are on the rise and fast.

Although I’d agree most of your statements, I’d like to challenge two of
them:

“Lothar Scholz” mailinglists@scriptolutions.com schrieb im Newsbeitrag
news:663952687.20030505174422@scriptolutions.com

Reasons for success

  1. Rubies OO functionallity is not so important in CGI like scripts
    (this means scripts that start with no internal variables other
    then session variables).
    This would only be an important point if you use an application
    server, but there is none.

Why would a CGI application benefit less from OO than other types of
applications?

  1. Everyone can learn PHP in a week, because it is much simpler
    Even designer and low paid students, which is commercially
    important.

I don’t know PHP too much, but I’d say that ruby is pretty easy to take
on. As many pointed out, it’s far easier than perl for example.

robert