Thomas Fini Hansen wrote:

>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. 
>
>  
>
Truer words were never spoken! I'm glad you wrote it so id did not have 
to get beat up over it.
Templatating systems seem neat and in many cases they likely work well.
But when you investigate the use of templates you might first consider 
the purpose - usually seperation of skills.
I find ruby syntax as simple and more capable than templates. ERuby can 
do this very well.

And as for stability i think that is a nebulous thing to define. I've 
been using mod_ruby for sometime and have stumped my toe more
than once but i think this has more to do with mysql and other libs and 
my own dumbness. I'm inclined to believe you could build a
system as stable as those others. Just keep it simple.

I'd just recommend looking into the shared interpreter issue with 
mod_ruby which basically means, realize other hosts might be using the 
same space...so be aware
of that and if curious things happen make sure you've partitioned your 
code thouroughly.

:Paul