3 ms·
I actually prefer this model of code generation to abstracting everything away into the plugin where I can't get at it. I generally do a lot of modification to
by jeremymcanally 17y ago
I actually prefer this model of code generation to abstracting everything away into the plugin where I can't get at it. I generally do a lot of modification to code in plugins, and having it generated and hackable right away is much easier to me than having to hunt it down, hack it in the plugin, dig through the plugin's tests, fix the test there, and then hope it didn't break anything else. Of course, if you're not skilled enough to be doing that sort of modification or your apps are simple enough it doesn't call for it, then that's no win for you.
But even so, to say the code that restful_auth generates is nasty either betrays your ignorance and/or shows that you tow some party line that I've never been privvy to. The code it generates is perfectly fine. It was written by Rick Olson, who (as I well know) is a fantastic developer. It doesn't support tons of extra bells and whistles like Clearance and friends, but who really needs a lot of the stuff they offer in every app? It's deadweight.
In fact, depending on which branch you get of the restful_auth plugin, the code it generates abstracts stuff away in modules that you include (so you don't have to go through that oh so cumbersome maintenance you seem so caught up on) and it generates all the stuff you'd have to create by hand for Clearance.
- theBobMcCormick 17y agoInterestingly, there's a new branch (http://github.com/technoweenie/restful-authentication/tree/modular http://github.com/technoweenie/restful-authentication/tree/m...) of Restful Authentication (labeled "Experimental Branch" in the README for the main branch) that backs away from the code generation approach of the current and previous versions of Restful Auth. To quote from readme in the modular branch of Restful Authentication: "The plugin now generates much less app-space code: the controllers are super skinny now, and if any security flaws are discovered it should be less painfulto stay current." I applaud their new direction, but IMHO the fact that this is their new direction validates my point that their old direction was just plain wrong. Code generation is little different than "cut and paste" programming.
- steveklabnik 17y agoThe main problem with generators is that it makes it much harder to upgrade to a new version. Then again, if you're hacking the plugin (as you apparently have to do) you're sort of stuck anyway. I've never had to do such a thing. crosses fingers