Simon Wilcox
Mon, 18 Jun 2001 09:44:02 -0700
Philip Newton wrote: > > Simon Wilcox wrote: > > I avoided HTML::Embperl, HTML::Mason & Apache::ASP because they all > > embed perl into the template which is a Bad Thing (tm). > > Why is that so evil? > > I'm willing to be enlightened here. > A couple of reasons. Separation of code & presentation is good because it means that your designers can concentrate on the design & html whilst your programmers concentrate on function. It helps if those not familiar with perl don't have to worry about it. They get a domain specific language that is easy to understand (TT2 scores well here because it hides the differences between scalars, arrays, hashes and object methods), and hopefully difficult for them to break. See this thread for Andy's take on this. http://www.template-toolkit.org/pipermail/templates/2001-June/001076.html Secondly, it helps with maintenance & reusability if all your perl code is in one place, there's less to change and less chance of thiongs going wrong. This really helps when the PHBs come along and ask if you can redesign the pages for a particular client. Whilst this can be done if you've mixed up perl into your template it makes it much harder because there is a lot more for the designers to break (and let's not even mention asp/php/jsp :) Now I accept that if you are the sole programmer/developer/designer on a project then it maybe doesn't matter but I have found that it helps me to work in a separated way, so when they say, as they have, "ah, we need the first two years in this table and the rest in that one" it becomes a presentation issue and not a perl coding issue [1]. HTH, Simon. [1] It was really easy to do in a TT2 template as well !