Dancer vs Catalyst [Perl Web Frameworks] [closed] - perl

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
What do you think about both?
I began reading a book about Catalyst, and found it pretty complex as compared to Dancer.
so now I'm giving Dancer a try, and it looks easier to learn and more "human friendly".

I think David's comment is very accurate and excellent. However, as someone who has done development in both but is not a developer on either perhaps I can be slightly more objective (and technical) in what the differences are.
Both frameworks provide a variation on the Web MVC paradigm.
Catalyst's main level of abstraction is the Controller. Catalyst expects you to break separate logic out into separate packages in some logical fashion (Login code goes here, Registration code goes there, Search functionality over here). This works incredibly well if you have a team of programmers since each of you can work on separate files and not step all over each other during merges. Catalyst provides a lot of tools for making the Controller logic extensible and flexible, I think the premier example of this is Chained actions which let you split up and build a complex flow for any given request. The downside is that it becomes very seductive to put your business logic into the Controllers and you end up with very fat logic in the Controllers where it (theoretically) belongs in the Model.
Dancer's main level of abstraction is the Route. My experience with Dancer is this leads to much smaller applications. Partly my experience here is tinged with the fact that I have dealt with several thousand line applications in Catalyst but I have yet to write a Dancer app that is longer than 200 lines (with a much smaller scope). I think however that this experience holds true. The push in Dancer is in keeping the Controller logic very thin because it doesn't have the same tools for managing complex behaviors there that Catalyst does.
Honestly I've enjoyed working in both of them. They both provide different opinions on what writing a web application is supposed to be. I would, given the time and inclination, recommend learning both ultimately.

This is a somewhat subjective question, but I'll try to give you an answer in an objective way. First things first, a disclaimer: I'm part of the Dancer development team, so my opinion should of course be considered somewhat biased :)
Catalyst is more widely used than Dancer, and so there's more community support behind it - if you were to look for contractors with experience working with either framework, say, you'd be more likely to find developers who've used Catalyst. So, if you're looking for commercial support, that would be a good reason to choose Catalyst.
Dancer is a younger project, and targeted more towards smaller projects, making getting up and running quick and easy, and trying to stay out of your way. That's not to say that Dancer isn't suitable for larger projects, however; the same habit of staying out of your way means you can organise your project in the way that suits you.
However, it has picked up a lot of support, and there's a growing community of helpful users and developers on IRC and the mailing list, and more and more useful plugins being released all the time. As with Catalyst, Dancer is designed so that you can pick and choose your preferred template engine, session storage backend etc, and it's easy to extend the framework by writing your own plugins if you need to.
For user testimonials to see what people say about Dancer, see the section at the bottom of the homepage on the new website: http://www.perldancer.org/
In the interests of showing other options, there's also Mojolicious, another modern Perl web framework which has been gaining in popularity lately.

Catalyst provides the same abstraction that Dancer does, Dancer's strength or rather Catalyst's weakness or rather Dancer's weakness is in how Catalyst forces the developer to adhere to Perl OO best practices and the MVC design pattern. After doing webapps for a while, this will all become apparent.

Related

What should I learn to become a good web developer? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm coding in PHP since a long time. And since a few days I've been looking for a job in web development.
Apparently they're looking for people who either knows ZEND or Symfony. I don't know either one (although I did work a bit on CodeIgniter).
And I really wanted to get into node.js these days.
So I'm asking you guys, what should I privilege to get a job? I have a feeling Node.js is going to become something really important and demanded, so I'd better get into it before others do...
What do you think? Are there other things out there I should learn? I really don't want to get into RoR since I do PHP.
I know this is a highly contested topic, but node.js is more of a buzzword than anything and it will not be a skill established companies are looking for. Many people have realized that javascript is far too nuanced to efficiently write large-scale applications, and that doesn't change once it's server-side. If you want job prospects, learn a statically-typed, managed language like Java or C#. These are not trendy, and for that reason a lot of people will tell me I'm wrong.
Agree, Node.js and jQuery are going to be the big winners here; for client side development anyway. Also, ensure you're well versed in CSS (especially CSS3) and are familiar with HTML(5) and how all of these work together to make beautiful web apps.
As far as server side development goes, you're really free to choose whatever, after all, it's rare the client ever sees the actual code that makes a WebService run. If you can make a reliable WebService in PHP, sure. C#? Why not? RoR? Java? Python? The more you know, the more marketable you are, and you get exposed to a lot more code. Personally, just because I'm forced into the big business world, C# is what I use almost exclusively, but only because I use it everyday.
If you get super adventurous, go for some understanding of SQL as well. And network setup etc. But that could be out of the scope of a web developer.
I would agree with the Node.js suggestion but would also learn the jQuery and jQuery mobile libraries for JavaScript.
They offer a huge amount of functions to ease web development along with support for HTML5 functionality. The other nice thing about this is you can write mobile web apps using jQuery mobile and support all platforms (iOS, Android, WP) with one app. It won't be native but it can still be a great looking app with a huge amount of functionality.
EDIT: Definitely agree with everything Breland says and in addition I'd like to emphasize that SQLite on the client-side would be something good to learn. It's a really nice feature where you can create a client-side database if you want to persist data that is a too big for a cookie or you can go with a real database.
Unfortunately AFAIK it's only supported on webkit browsers right now (Safari, Chrome, Android, iOS) but it could be good to learn how to use this and also an ORM like persistencejs which is a jQuery plugin that creates an ORM for SQLite and can work on the client or server-side.
These days, a "Web Developer" means something else than what it used to 3 or 4 years ago. That skill set is further split into disciplines now, mainly front-end and back-end. The path you go with will likely be based on what you've been comfortable doing as a PHP developer.
If you've been building PHP apps the "traditional" way and controlling all aspects of your MVC apps through PHP then learning modern PHP frameworks that make that approach easier would be an easy next step.
If you've been building PHP backends that expose business logic through an API or service layer, you can stick to the backend track and learn to do the same in Ruby on Rails (using something like rails-api) or Node.js if you wish. If you go the node.js route, picking up CoffeeScript will make writing your JavaScript a little more comfortable but it's another syntax you'll have to learn.
If you've done both 1 and 2 above and you like client side development, learn modern Javascript web development. Don't worry too much about which framework to side with yet, just learn the modern way of building large JS apps. A book I recommend for that is JavaScript Web Applications by Alex McCaw (http://shop.oreilly.com/product/0636920018421.do). It did wonders to help me shed my dislike of JavaScript which came from working with the language many moons ago.
My advice would be to learn both sides of the fence and master one or two frameworks on each side. That will make you what's now called a "full stack" developer, which is just a term used to identify those who are effective at client and backend dev thereby making them highly desirable in the marketplace.
Good luck.

What is the best language in which to write an expert system? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Is LISP or something like Jess the best choice? I'm interested in writing a program that makes a suggestion based on users' answers. Computational considerations are not really a factor this is pretty much a pattern matching engine. Also I would like to make an app for this and put it up on the web.
UPDATE: I would like to put this up on a blog or website and let people use it from there. I guess my question then is there a particular inference engine that works with the .NET family, or PHP, or something to that effect? What are some of the pros and cons of each options etc.
Step 1. Pick an inference engine. There are many choices. Here's a list: http://en.wikipedia.org/wiki/Expert_system#Shells_or_Inference_Engine
Step 2. Use the language that interfaces with the inference engine.
You'll be much happier leveraging an inference engine for expert systems work.
I would like to put this up on a blog or website and let people use it from there
Trivial.
is there a particular inference engine that works with the .NET family, or PHP, or something to that effect?
Doesn't matter.
Here's the confusion. Your "web site" and your "inference application" have NOTHING to do with each other. Nothing.
Your web site can be done in any tool set you can find. It doesn't matter.
Your inference application can be done in any tool set you can find. It doesn't matter.
Your web site will invoke the inference application through any API that makes sense. The lowest common denominator in API's (the reason that none of these choices matter) is to do this.
Write your inference application as a stand-alone command line tool.
Write your web application to run the stand-alone tool, collect the output and turn the output into an HTML page.
Note that this multi-porocess implementation may be faster and make better use of multi-core processors. It forces the OS to manage the web server (Apache HTTPD, for example), the web application and the expert system as potentially three, separate, parallel processes.
You can also take a look at Prolog. SWI-Prolog (http://www.swi-prolog.org) is very complete and has an HTTP support library included (http://www.swi-prolog.org/pldoc/package/http.html). This paper might be helpful in using SWI-Prolog on the web ("SWI-Prolog and the web" http://dare.uva.nl/record/285350)
And, you can find a tutorial on building expert systems with prolog at: http://www.amzi.com/ExpertSystemsInProlog/
You will hear a lot of subjective opinions here, since few people have experience in more than one language writing expert systems.
I can recommend Common Lisp, as there is quite some literature and existing code available in this language, and it is a very powerful language and not too difficult to learn (read "Practical Common Lisp" by Peter Seibel). Of course, any new high level language requires some effort to learn. For the web application, you can use, e.g., Hunchentoot and CL-WHO, and there are a lot of database bindings (I like Postmodern and CL-SQLite).
I would suggest CLIPS and its .net port clipsnet
http://sourceforge.net/projects/clipsnet/

Why to build own CMS? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
On my first job interview, I was asked why did I build my own CMS? Why not to use one of existing CMS, Wordpress, Joomla, Drupal...? At first, I was stunned. I couldn't immediately recall all of my reasons for building my own CMS, but this was definitely one of the main reasons: It's my code and if I want to change something in that CMS (which I often have to do, because each website I build needs CMS with different functions) it's not a big problem. For some time I've been using Wordpress and one of the main things that distracted me from using it was discovering bugs in code that wasn't written by me and this bugs were often, especially if I made some changes to CMS or added a plugin...
Here, I can find these 8 reasons why NOT to build own CMS:
It won’t meet users’ needs
It’s too much work
It won’t be a standard solution
It won’t be extendible fast enough
It won’t be tested well enough
It won’t be easily changeable
It won’t add any value
Create content, not functionality
Quote from the same page:
So the main question to ask yourself
is: ‘Why am I really trying to
re-solve a problem that has already
been solved before?’
Well, I definitely agree that it's hard to invent CMS that hasn't been already invented, but on other hand, I think every CMS is (or should be) individual... it maybe won't have a million of functions, it will have 3 functions but their usage will be clear (to a user) and do all that one site needs to have. I think also that it is not good to give to a client a CMS with a lot of functions that are never used and it looks probably more professional when website and CMS together look like one product.
I would also like to comment some quote parts:
"It’s too much work" - I agree, but when using existing CMS and customizing it to website needs and can sometimes be very hard job or mission impossible.
"It won’t be easily changeable" - I disagree with this one.
What is your opinion on this one, why did you develop or didn't develop your own CMS?
Ile
This is an interesting question that applies to most development, not just when building a CMS.
In general, I would say that it's a bad idea to reinvent the wheel (and most of your 8 arguments are correct in most cases), but there are exceptions. The first one that comes to mind is one from Joel Spolsky, In Defense of Not-Invented-Here Syndrome:
If it's a core business function -- do
it yourself, no matter what.
The point is, if you're making your money directly from building content management systems, you should not take one from someone else and tweak it until it fits you. You'd rather be in full control over your own product.
Edit:
Also, don't forget that the urge to reinvent things stems (among other things) from a fundamental law of programming:
It's easier to write code than it is to read it
This does not mean that we should take the road that appears to be easier but it explains why we fall for it. Take the challenge and actually read some code, rather than write it, from time to time.
I would build a CMS because it can be fun and a great learning experience.
However, any open source CMS can be customized to any client's need. The biggest problem is that you have to understand how that CMS works in order to be able to change it well.
Either way you would be faced with quite a big task, but I must agree with those who say that you shouldn't start from scratch (unless you are doing it to learn some new technology) exactly for the reasons stated in your question... As they say, don't reinvent the wheel unless you want to learn about wheels.
I've found it works when the context of the project is larger than just a 'content site'. I've worked on a number of real estate sites where the bulk of the content is coming in from data feeds, or already existing in databases that have had their structure set up long before you were involved. Really, we only had a handful of BS 'content' pages that made up the site that were rarely updated. What they really needed was a simple interface to data entry. It was far easier to build some one off components than try and shoehorn an existing system on top of an out of the box CMS.
Like others mentioned though, you must consider overall requirements. Is there workflow involved? Dynamic navigation? Then I'd start leaning more towards out of the box CMS's, but many times people say they need a CMS, when they really just need a WYSIWIG interface to a database. But sometimes not...
It seems to me that the biggest reason NOT to build your own CMS (besides security issues) is lack of support and upgrade path. I consider it a disservice to clients to put them on a custom CMS and then have to rely on you only support and updates. Even worse is having them pay for the development of the custom CMS - they are paying you to reinvent the wheel no matter how simple the site requirements are.
There are plenty of CMS options out there that will allow you to add your own custom extensions if your requirements are beyond what is built in.
The best reason (possibly only) to build a custom CMS is to learn a language well. Building a CMS is a great way to learn web development, but it's not a great way to service your clients.
As a team leader that is always being pushed to do more with less, I too ask the question "why would you write your own?" There are more CMS packages out there than there are programming languages and I find it difficult to believe that you cannot find one that meets most (if not all) customer, business and cost requirements.
If you find that code changes are needed, opt for an open source solution, make your changes and share as needed or desired.
I do know that many times a CMS systems is NOT what is needed. Many customers need a Content Editing System. What I mean is that someone technical puts a site in place and the customer adds/edits/removes pages. The pages are already well designed and formatted. In these cases, I can see where it may be quicker to design & implement something from scratch rather than chopping down a CMS with access rights or removing/hiding functionality.
Unless you're building one for the experience, there's only one real reason for building your own: It's cheaper and/or easier than using one on the market that meets your requirements.

What programming language would be best for creating a roguelike game? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
With the interest of creating a roguelike RPG (such as Nethack, Rogue, and ADOM), which programming language would be most suitable and why?
With the language that you choose, be sure to list any libraries or facets of the language that make it particularly well-suited.
Way back in the day I tried to write Roguelike games using QuickBASIC out of all things (it was 1988.) Not the recommended approach...
There are still some development circles out there. Here's an FAQ on Roguelike Development and also a blog dedicated to the same.
My language of use (I'm trying to create roguelike too) is Python, because:
It's high level programming language, I don't need to think about memory allocation all the time, etc, but keep my mind on algorithms.
There's tons of useful libraries for almost everything. Recently I've found TDL/libtcod which can be useful for roguelike development.
With bindings you can easily use C/C++ libraries or even write few critical functions in C/C++, and use them.
It's the most readable programming language I've ever seen.
While programming in Python I've learned to use internal documentation. It's very helpful thing, I just read my code few months later and I still know what it's doing.
That's a very personal choice as always :-)
I wrote my Roguelike game (Tyrant) in Java for the following reasons:
Very portable (even with graphics)
Garbage collection / memory management
Lots of good free / open source libraries available (helpful for algorithms, data structures and manipulating save game files etc.)
It's a statically typed language - this has performance and robustness benefits which I judged to be worth the additional coding complexity
I wanted to hone my Java skills more generally for use in other projects
EDIT: For those interested it is open source, all code is available at SourceForge
Well I've made a couple roguelikes in C, spending a fair amount of time at roguebasin, which is a great site for anything related to roguelike development.
As for what language you should use, I don't really see it making a huge difference. I pick C because of the portability, and a lot of libraries work well with it.. But an object oriented language can clean up some things that you may not want to keep track of.
There aren't any languages that I would consider to be specifically greater than the rest for roguelikes. If you're making it graphical, you may prefer something that has that built-in, such as flash / silverlight. But even then there are libraries for any other languages that bring them to about the same degree of difficulty in that regard.
So I'd say take a language you know and like, or that you don't know and want to learn..
Most of these answers are great, but there's something to be said for the combined power of object-oriented stuff and low-level commands that can be abused in C++. If you're looking for some inspiration, the C sourcecode to NetHack is widely available and documented well enough that you can certainly poke around to learn some things. That said, it's a huge project that's been growing for decades, and not everything is as clean as you're going to want things for your own project - don't get roped into making poor design choices based off of what you find in NetHack.
Honestly, though, in terms of what you use it probably doesn't matter at all - though I'd highly recommend using an OO language. There's so much crap to handle in a roguelike (heck, any CRPG really) that OOP is the easiest way of staying sane.
The original nethack was written in C, and the source is available if you want to get some ideas about how it was written, and the challenges you may find which might be a good way to start deciding on a language.
My first question would be whether the game is going to have a web based UI or be some kind of console/window affair like the original Rogue-like games? If the former I would say that any language you're comfortable with would be a good choice. Ruby on Rails, Python/Django, PHP/CakePHP, etc. would all be great.
But if the answer is the latter, this is a game that you want people to be able to download and install locally, I'm going to go with Java. It's a great language with no memory management for you to deal with. It achieves very high performance thanks to just-in-time compilation and optimization, and it has an extremely rich library to help you with data structures, Swing makes for some really beautiful UIs, and the 2D library allows for the most rich cross-platform rendering outside of PostScript. It also has the availability across Windows, Mac OS X, and Linux that you're not going to get from some other choices.
Finally, distribution of your application is easy via Java Web Start as well, so people can download and install the game with just a couple of clicks once they have Java and keep it on their machine to run as long as they like.
For making any game, any language will be right if :
you can use it (you are able to use it, by knowledge or if it's easy enough to learn right now for you or your team)
it produce applications that runs on your client's computer
it can easily produce applications that runs fast enough for your game's needs.
I think that for a Rogue-Like, any language you know will be right as far as it runs on you target. Performances are not really a problem in this kind of game. World generation can require high performance if your world generation is really complex though...
just go with something that will handle the low-level details for you. whatever you know should work.
hey, they can write one in javascript.
I recommend Actionscript for those games.
You could consider Silverlight.
It sits on top of C# and .Net so theres not much need to worry about memory management. With SL you'll get built in support for scene graph type rendering - culling of things not on screen, Key board, mouse events, clicks on objects etc.
There's an initial learning curve, but I find it's a great environment to work in.

Suggest some good MVC framework in perl [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
Can you suggest some good MVC framework for perl -- one I am aware of is catalyst
The need is to be able to expose services on the perl infrastructure which can be called by Java/.Net applications seamlessly.
I'll tell you right now that Catalyst has by far the best reputation amongst Perl developers in terms of a rapid application development MVC framework.
In terms of "pure" MVC I'm not sure there are even that many "mature" or at least production-ready alternatives.
If Catalyst doesn't seem right to you, then you could build upon the lightweight framework CGI::Application to suit your needs or take a look at some of the lesser known MVC frameworks like PageKit and Maypole.
Since this old thread popped up, I will mention two exciting new additions to the Perl MVC world:
Dancer (CPAN) which is heavily influenced by Ruby's Sinatra, known for being very lightweight
Mojolicious (CPAN) which is written by the original developer of Catalyst to use what he learned there, it has no non-core dependencies, with very modern builtins (HTML5/CSS3/Websockets, JSON/XML parsers, its own UserAgent/templating engine)
(N.B. I have used Mojolicious more than Dancer, and as such if I missed some features of Dancer that I listed for Mojolicious then I apologize in advance)
Another alternative besides the ones already mentioned is Continuity; however, it is (as the name is meant to imply) continuation-based rather than MVC in the typical sense. Still, it’s worth mentioning because it is one of the better Perl web frameworks.
That said, I like Catalyst much better than any of the alternatives. And it’s still getting better all the time! The downside of that is that current preferred coding approaches continue to evolve at a fairly hurried clip – but for the last couple of versions, there has been strong emphasis on API compatibility, so the burden is now mostly mental rather than administrative. The upcoming port of the internals to Moose in particular is poised to provide some excellent benefits.
But the biggest argument in favour of Catalyst, IMO, is the Chained dispatch type. I have seen nothing like it in all of web-framework-dom, and it is a most excellent tool to keep your code as DRY as possible. This couples well with another great thing that Catalyst provides, namely uri_for – a method which takes a controller and a bunch of arguments and then constructs a URI that would dispatch to that place, which it returns. Together, these facilities mean that you can structure your URI space any way you deem right, yet at the same time can structure your controllers to avoid duplication of logic, and keep templates independent of the URI structure.
It’s just brilliant.
Seconding comments made by others: Catalyst (which more or less forked from Maypole) is by far and away the most complete and robust of them. There is a book by Jonathan Rockway that will certainly help you come to grips with it.
In addition to the 'Chained' dispatch type, the :Regex (and :LocalRegex) dispatch methods provide enormous flexibility. The latest app we've built here supports a lot of disparate-looking URLs through just a handful of subs using :LocalRegex.
I also particularly like the fact that you are not limited to a particular templating language or database. The mailing list (and the book) both have a preference for Template::Toolkit (as do I), and DBIx::Class (we continue to use Class::DBI), but you can use pretty much anything you like. Catalyst is marvelously agnostic that way.
Don't be put off by the fact Catalyst seems to require half of CPAN as dependencies. Once you get it up and running, it is a well-oiled machine. It has reached a level of maturity now that once you come to grips with it, you find it 'fades into the background'. You spend your time solving business needs, not fighting with the tools you use.
It does what it says on the tin. Catalyst++
Been playing with Squatting the last few days and I have to say it looks very promising and been fun to use.
Its a micro webframework (or web microframework ;-) and is heavily influenced by Camping which is written in Ruby.
NB. Squatting (& Camping) don't have model components baked into the framework. Here's the authors comments on models... "Models? The whole world is your model. ;-) I've always been ambivalent about defining policy here. Use whatever works for you"
There is also CGI::Application, which is more like the guts of a framework. It helps a person to write basic CGI's and glue bits on to it to make it as custom as they like. So you can have it use hardly any modules, or just about everyone under the sun.
Catalyst is the way to go. There is also Jifty, but (last time I looked), it had terrible documentation.
If you are already aware of Catalyst, then I recommend focusing on it. It is mature, well-documented, and has a very large user-base, community, and collection of plug-ins.
For your problem I would take a look into Jifty::Plugin::REST which allows access to models and actions using various formats.
Let me just say that Jifty doesn't have terrible documentation. However, most of included documentation is API documentation, but there is very low-noise mailing list which has useful tips and links to applications.
Wiki at http://jifty.org/ is another resource which has useful bits.
If your goal is to make video store (my favorite benchmark for 4GLs and CRUD frameworks) in afternoon, it's really worth a look!
Another options is Gantry when used in conjunction with the BigTop module it can reduce the time it takes to build simple CRUD sites.
There is also Clearpress which I can recommend as a useful database backed application. It needs fewer dependencies than Catalyst. We have written a few large applications with it, and I run a badminton ladder website using it.
I have built some applications with Kelp, it's easy to learn and very helpful.