3 ms·
> Sure, Rails itself is straightforward, but the frameworks you slap on top of it can quickly become burdensome abstractions: RefineryCMS, Devise, Omniauth, Ca
by Skoofoo 14y ago
> Sure, Rails itself is straightforward, but the frameworks you slap on top of it can quickly become burdensome abstractions: RefineryCMS, Devise, Omniauth, Carrierwave, Unicorn, Rack Rewrite, Fog, New Relic, Foreman, AMQP, and Honeybadger, not to mention the extra magic that Heroku gems throw into the mix (backups and other fun).
You don't need to use any of these. I once tried to use Devise for a project. I fiddled with it in an attempt to make it work exactly the way I wanted, but eventually I gave up and just rolled my own authentication. It's not hard at all to do in Rails, and you end up with much simpler code. I also tried New Relic, but I didn't see much point to it (maybe it's more useful for apps with a ton of traffic) and they sent me spam until I asked them to stop several times.
- tmo9d 14y agoBut, Devise is one of the better frameworks out there. Along with Omniauth it saved a huge amount of work. I'd reconsider Devise and look at Omniauth, it is a huge time saver. New Relic is awesome, but expensive and they do have an aggressive marketing automation thing going on with the emails and such. But, you can't blame them for that, they have to pay the bills and more power to them for that.
- Skoofoo 14y agoI think it's a matter of personal taste. Devise is a pretty large library that deeply entrenches itself in your application and expects you to do things in a certain way. I personally don't think it's worth the added complexity, instead I prefer using standard Rails features [1] to build exactly what I want. But then, others may feel it's not worthwhile to even use Rails and instead prefer to use Sinatra or Flask. Every developer seems to have their own comfort zone in terms of how much control they have. For instance, Linus Torvalds won't even use C++ over C [2]. Omniauth looks like something I would use, though. As for New Relic, I certainly can blame them for spamming. I realize that everybody's gotta eat, but there is no excuse for them to send me "I wanted to connect regarding your interest in the New Relic trial. So far I have not been able to successfully reach you." after I already sent them two emails telling them to stop emailing me. Annoying anyone who hands over their email doesn't strike me as a particularly ethical business strategy. [1] http://www.farbeyondprogramming.com/2011/05/rails-user-authentication-using-has_secure_password/ http://www.farbeyondprogramming.com/2011/05/rails-user-authe... [2] http://harmful.cat-v.org/software/c++/linus http://harmful.cat-v.org/software/c++/linus
- ritchiea 14y agoThis is where I lost a lot of faith in the author. His argument becomes "Rails get's tricky when you frankenstein a bunch of gems and additional frameworks into an app." I'm totally with you, I don't get the Devise obsession. It's easy to roll your own authentication. In the app I'm working on right now one of my co-workers once said "we don't even have a gem for authentication" and I wanted to pull my hair out. Eventually I incorporated Warden into our auth process which moves authentication to middleware and provides some useful test functionalities. And the whole Warden library is readable. Devise is actually built on Warden and you can get a lot of good, simple implementation ideas from reading the Devise code rather than wholesale slapping their entire API into your app to replace what might be a few dozen lines of auth code for a lot of projects. If you Frankenstein your app together at every chance you're failing to manage complexity because you end up dealing with a dozen APIs (or dozens!) all designed in different styles by different developers. At this point you not only need to know Ruby and Rails but also the API of every framework you have added. I'm not saying don't use gems but eventually if you don't write any code yourself you're going to have a complex mess you don't understand. And that's not Rails's fault.