[dancer-users] Dancer vs Mojolicous

Octavian Rasnita orasnita at gmail.com
Fri Mar 15 18:41:53 GMT 2013


From: igor.bujna at post.cz 


  Hi,

  i don't want to start flame, but only ask when I make any project, why do I should choose Dancer instead Mojo*. 

  Thank you for yours answer.

   

   

   

  David and Damien already gave a better answer. 

   

  I can tell you how I chosen to use Dancer and maybe it will help you also. 

   

  I like to use Catalyst (with DBIx::Class) because it offers very many features, it is not a micro-framework which is suitable for projects hosted on servers with enough memory and resources. 

   

  But some web apps must work on a VPS that has only 512 MB RAM in which I also need to run other programs (like a MySQL db), and in that case I prefer to use a web framework that consumes less memory and eventually skip using DBIx::Class also. 

   

  So the options are Dancer, Dancer2, Mojolicious, and Mojolicious::Lite because I never was a fan of CGI::Application or other older Perl frameworks. 

   

  Between Dancer and Dancer2 the option is Dancer2, because it allow using configuration files in other formats than YAML and it uses Moo and it is a newer version of Dancer anyway, even though Dancer2 seems to consume much more memory than Dancer. 

   

  I read Mojolicious documentation but I've seen that it doesn't have an automatic URL dispatcher, so all the URL mappings should be defined manually in a separate file, and when some changes are made in the code, that file must be also updated. In some cases this method might be good, but for what I need and prefer... it is not. 

   

  So I needed to choose between Dancer2 and Mojolicious::Lite. 

   

  I liked the way Mojolicious::Lite use methods of $self in the subroutines, which is very Perlish OOP, but I didn't like that it promotes its own way of doing everything instead of using other (and better known) CPAN modules. 

  And then I found that Dancer2's way is more clear and elegant, although it is not very Perlish (or maybe exactly for this reason :-) 

   

  Dancer2 doesn't offer so many features as Catalyst, it is a bit lower level, but this makes it more flexible and it doesn't stay in your way when you want to do something which is not very common. 

   

  I prefer to be able to use a framework that can work well with the modules I like - DBIx::Class, Template-Toolkit, Moo... and not with a framework that recommends using other similar modules. 

   

  This is how I've chosen to use Dancer2 for smaller projects and Catalyst for bigger ones.

   

  Octavian 


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20130315/bb752d20/attachment.htm>


More information about the dancer-users mailing list