Lately I’ve been getting a lot of pressure to add a generator to Authlogic. One of the big things I “tout” about Authlogic is the fact that is does not need generators, not anymore than any other RESTful controller you create. Authlogic can pull this off because it’s intuitive, it works just like every other model you have in your application. Unless you want to customize how it works, there’s no learning curve. If you know how to set up a RESTful controller for an ORM model, then you know how to set up a RESTful controller for an Authlogic model.
In my opinion generators are meant to be a starting point for repetitive tasks that have no sustainable pattern. By repetitive, I mean repetitive in a single application. Ex: multiple controllers, multiple models, etc. 95% of applications are going to create 1 Authlogic model and 1 controller for that model. If they are creating more than one, it is mostly likely for a highly unique situation where a generator would be of no use. Which leads me to my question:
Why not just create your own personalized base application or template that you can start from when you need to start a new application?
This is exactly why rails templates were created. They were created for this exact problem. A generator is never going to please everyone, and if it does, it would have a million options and be extremely complicated. Also, I don’t know about you, but I am extremely picky about my code. Even if my code and someone else’s code does the exact same thing, I want my code formatted a certain way. This is a big reason why I dislike restful_authentication. All of this code, that I do not like, gets inserted into my application. It just feels dirty. I’d much rather build my own authentication solution into a base app, that I like, and use that in my next application.
I just haven’t been convinced that creating a generator for Authlogic is a good use of my time. If you can convince me otherwise I’ll gladly do it. It’s not that I don’t want to spend the time, its that I truly feel a base app or a rails template is a better solution.
What do you think?