[Dancer-users] how to improve the code of PEG?

P Kishor punk.kish at gmail.com
Sat Nov 20 17:13:01 CET 2010


On Sat, Nov 20, 2010 at 9:43 AM, Gabor Szabo <szabgab at gmail.com> wrote:
> On Sat, Nov 20, 2010 at 3:52 PM, P Kishor <punk.kish at gmail.com> wrote:
>>
>> Looks fine to me, but I have to ask... why bother with Dancer? As you
>> said, it is a static site, so why not make it completely static? Don't
>> even use Perl if you don't have to... My own application web site uses
>> a static front-end, with a reverse proxy to a Dancer powered web site
>> for one application inside of it. So, use the tool where needed. The
>> old saw, "make it as simple as possible, but not simpler."
>
> I started with a totally static site that I generated from some TT templates
> but that way every change requires a rerun of the processor before I can
> actually see the outcome. With Dancer the turn around was easier.
>
> As we add more stuff we will have more and more thing to generate,
> eg. now we already have some real code generating the events page
> even though that too could be static.
>
> Later we might add some interactive things but that's not sure yet.
>
> Finally, and maybe most importantly, it gives me an excuse to learn
> a bit about Dancer.


In that case, the only suggestion I would add is to use something like
Template::Tiny (use 'template: "tiny"' in your config file).

I have now created three web sites with Dancer, ranging from moderate
to fairly complex, and I am yet to hit the limits of Template::Tiny.
And, it is true to its name, really tiny and fast compared to the real
TT.

That way you will have code and view separation, would be able to
modify your content without potentially screwing up the site with a
tiny typo or a misplaced semi-colon.

In my personal web site, all the content is stored in plain text files
that are simply read in and fill the template. I do use sqlite for
some metadata stuff (hard to store multiple attributes in flat files
and make them searchable as well), but other than that, everything is
as low-tech as possible.


>
> regards
>   Gabor
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================


More information about the Dancer-users mailing list