From: Eric Schwartz Date: 2003-05-07T04:51:36+09:00 Subject: Re: Why is PHP so popular? What can we learn from the PHP camp? "Robert Klemme" writes: > "Lothar Scholz" schrieb im Newsbeitrag > > Because a CGI script (or better any non application server like > > script) starts with zero data. It loads all data, processes them and > > outputs the data. With this constellation there is often not much to do > > so no need for a technical better solution. > > This does not convince me. Are you saying that generally small programs > don't benefit from OO? Most small ruby scripts I'm writing contain at > least one new class, because that way I can tackle problems more easily > (at least it's easier for *me*). I have to say that one of the things I like most about using Ruby for CGI is the fact that for CGI programs with more than one aspect to them, it's a lot easier to model it as an MVC pattern than it is to write things in procedural languages. Compare: my (undef, $one, $two, $three) = split ('/', path_info()); if(defined $three) { doSomething(); } elsif(defined $two) { doSomethingElse(); } elsif(defined $one) { doSomethingCrazy(); } else { default(); } with: model = ModelFactory.newModel(path_info) view = ViewFactory.newView(model, path_info) view.draw(); -=Eric -- Come to think of it, there are already a million monkeys on a million typewriters, and Usenet is NOTHING like Shakespeare. -- Blair Houghton.