From: Florian Weber Date: 2004-07-25T21:50:58+09:00 Subject: Re: rubyonrails and cgikit comparison > The reason I said it seems cgikit better separates presentation and > logc, is that in http://media.nextangle.com/rails/ror2bc.pdf, I saw > this code: > > <% for comment in @post.comments %> >
  • <%= comment.value%>
  • > <% end %> > > This may be a question of personal taste, but I really prefer the > cgikit solution where there's absolutely no reference in the template > to the data we're working on. Now, this opinion is only based on > reading the pdf available on rails at the url mentioned. Can someone > correct me or > give another opinion on the subject? you have a reference to the data you are working on. "myrepetition". the only difference is thate you have a bridge with the binding file. in the template you only refer to the binding file and the binding file refers to the 'real' data. i have to admit i dont really see the advantage of it. why the overhead of the binding file? for sure there is the good old 'designers/html-people can edit templates' without having to worry about the programming under the hood. but isnt it so much simpler to learn some basic ruby constructs instead of yet another template language, where sooner or later you run into problems/limitations. with cgikit for example you must know whats going on below the template, how would you know otherwise which properties you can use for the repetition item, how its named, etc? for simple views something like xml might work okay. but for more complex stuff it becomes very tricky, sometimes even impossible. you need something like a 'programming language'. http://www.martinfowler.com/bliki/UseOfXml.html for sure you can extract everything even remotely complex/programming language like into components. but thats such a overhead. for sure at first you might think 'well, i might be able to reuse component later on'. but how can you know? it certainly doesnt apply for every situation. so yagni really applies here.. i hope i dont come across to mean with cgikit. i think its a good think. i just made some really frustrating experiences with xml templating systems, so im kinda bitter about it =)