Eruby vs php/jsp

Thanks. I will check the template system while RAA returns operation. My
main concern of this problem is to make it as stable as possible. I would
like to use ruby because it is so powerful and easy to use, but if it is not
very stable (for the web solution I mean) and not very well supported then I
have to consider jsp or php etc…

Sincerely,
Shannon

···

From: Thomas Fini Hansen beast@system-tnt.dk
Reply-To: ruby-talk@ruby-lang.org
To: ruby-talk@ruby-lang.org (ruby-talk ML)
Subject: Re: eruby vs php/jsp…
Date: Sat, 29 May 2004 21:05:11 +0900

On Sat, May 29, 2004 at 08:18:42PM +0900, Andreas Schwarz wrote:

Shannon Fang wrote:

Hi All,

I am planning a web site for my company that provide e-commerce related
contents/services. I consider using eruby + mod_ruby.

I do not think that mod_ruby + eruby is a very good solution (embedding
code in HTML is evil), you should look at a templating system like
kwartz + FastCGI.

I don’t entirely agree. Yes, having your ‘business code’ in your HTML
is bad juju, but careful with the seperation there.

Most interesting ‘templating systems’ seem to be mini-scripting
languages in themselves, because one do need different programming
constructs when generating HTML.

I was looking around at different templating solutions at one time,
because I wasn’t particularly happy with anything. Stuff like Smarty
for PHP, while being very fancy and powerful, just seemed… Wrong
somehow. It was just rubbing my aesthetics the wrong way.

I stumbled across a page where someone was making much the same point,
while the idea of having this ‘easy language’ for your designer seemed
like a good idea, it just muddles thing up when you and your designer
have to learn this minilanguage, nevermind the time you might spend
supporting the more or less well thought out templating system.

So why not just use Ruby for the templating? Of course your designer
will still have to learn the basics, but you’ll save a bit of
time. And when he comes with this odd idea, you can just give him a
magic-block-of-code to fix his problem, and not waste your time
because the templating system doesn’t support getting every 3 item of
an array, or some sort.

Some might say that the same goes for PHP or Perl, but I think Ruby
got an edge there in it’s marvelously clean syntax.

So having thought these thoughts, I was rather happy to se that this
was indeed what David is doing in Rails. The templates is just eRuby
which get everything it needs handed down from the controller
including some convinience methonds, so the most it usually has to do
is <% foreach post in @posts %>. So all you got in your templates is
presentation logic.

Davids done all the hard word for you in Rails, but there’s really no
reason why you shouldn’t be able to use the same principle in mod_ruby

  • eRuby.


Thomas
beast@system-tnt.dk


Express yourself with cool new emoticons http://www.msn.co.uk/specials/myemo

Hi Shannon,

Working in a PHP-MySQL Enviroment, I find some basic Problems of this
approach.
As an embedded lang PHP seems to be a perfect solution for any database
driven web application. But sooner or later you will have to change the
logical strukture xor the visual representation of our app (maybe, if your
boss or some customers need any changes). Then your WILL run into
difficulties, because in PHP these two things are one. One the other Hand
this is the strength of PHP, but for changing projects it’s necessary to
separate the “logic” from the “view”.
Imagin, that in a couple of month another person is engaged to do the visiual
part of the web service, who only knows html. IMO it would be a waste of time
for him to learn PHP, because it does not do any visualisation. This is the
job of html,css and javascript.

The IOWA-Project may be something for you: http://beta4.com.iowa

Ralf

That version of Iowa is old. Very old. And it lacked some features that
made it really easy to use for web application projects.

I’ve been working with Iowa for more than two years with many projects, and
have a new release of it along with a growing body of documentation.

http://enigo.com/projects/iowa

is where the documentation lives.

Iowa itself is at Rubyforge: http://rubyforge.org/projects/iowa

Kirk Haines

···

On Tue, 1 Jun 2004 16:24:47 +0900, Ralf Müller wrote

The IOWA-Project may be something for you: http://beta4.com.iowa

You can separate the “logic” from the “view” in PHP just as well as you
can in Ruby. You can also create Ruby web applications that don’t have
good separation. It’s really an issue of design. Granted, Ruby IMO is
a better language to program in, but PHP per se can still produce
well-designed applications.

Carl

···

On Jun 1, 2004, at 12:24 AM, Ralf Müller wrote:

Hi Shannon,

Working in a PHP-MySQL Enviroment, I find some basic Problems of this
approach.
As an embedded lang PHP seems to be a perfect solution for any
database
driven web application. But sooner or later you will have to change the
logical strukture xor the visual representation of our app (maybe, if
your
boss or some customers need any changes). Then your WILL run into
difficulties, because in PHP these two things are one. One the other
Hand
this is the strength of PHP, but for changing projects it’s necessary
to
separate the “logic” from the “view”.
Imagin, that in a couple of month another person is engaged to do the
visiual
part of the web service, who only knows html. IMO it would be a waste
of time
for him to learn PHP, because it does not do any visualisation. This
is the
job of html,css and javascript.

The IOWA-Project may be something for you: http://beta4.com.iowa

Ralf

“Kirk Haines” khaines@enigo.com writes:

···

On Tue, 1 Jun 2004 16:24:47 +0900, Ralf Müller wrote

The IOWA-Project may be something for you: http://beta4.com.iowa

That version of Iowa is old. Very old. And it lacked some features that
made it really easy to use for web application projects.

I’ve been working with Iowa for more than two years with many projects, and
have a new release of it along with a growing body of documentation.

[ … ]

If I recall correctly, the earlier version of iowa did not work with
Apache-2.x. Does this current version work with mod_ruby under
Apache-2.x?

Thanks.


Lloyd Zusman
ljz@asfast.com
God bless you.

I’m pretty sure that I tested that configuration with no problems. I have
that configuration on my development box. Let me double check it today and
confirm that I’m not misremembering, but I would be surprised if there were
any problems.

Kirk Haines

···

On Wed, 2 Jun 2004 03:05:46 +0900, Lloyd Zusman wrote

If I recall correctly, the earlier version of iowa did not work with
Apache-2.x. Does this current version work with mod_ruby under
Apache-2.x?