But diving into Rails revealed many irritating "features" like methods being available from nowhere eval'ed from string (yeah, this seems to be the main argument used by konryd when he nags me about Django being better than RoR (and Python being better than Ruby ;P). Also testing RoR app is far from being pleasant, I spend vast of my working time writing tests and dealing with crappy bugs that RoR gives me. As for example: today for the n-th time I came across the nil.rewrite failure when testing, which happens to show when you try to invoke some method from your controller before making any test request (with get/post/put/delete) - to avoid it, you have to make a dummy request, so that Rails sets everything up correctly :/
I must admit that Rails are not perfect, they are even far from perfect, but for a beginner developer being a perfect framework to start with. Now I need something more flexible, where I can have ORM of my choice by default, don't have methods eval'ed from string, included in where-the-f**k-is-that-from modules. So I decided to give Merb a try. Maybe I will convert the app I'm currently working on to use, although this will be a very hard task, after my experience trying to change just an ORM (from ActiveRecord to DataMapper or Sequel)
One more thing: Rails plugins. I hate them. Really. They work well when you need almost exactly the same behaviour in your app, but if you want to change something, then you are f***d - dirty hacks are almost always needed. In fact, even without this, they need dirty hacks, take a look at this monster:
def without_revision(&block)
class_eval do
CALLBACKS.each do |attr_name|
alias_method "orig_#{attr_name}".to_sym, attr_name
alias_method attr_name, :empty_callback
end
end
block.call
ensure
class_eval do
CALLBACKS.each do |attr_name|
alias_method attr_name, "orig_#{attr_name}".to_sym
end
end
end
So ugly.
1 comment(s):
Three things:
1. As former Java developer I agree, that Rails is good framework for learning web apps. Three months ago my knowledge about them was ZERO. Now I am able to create my own application from scratch and I understand pretty well how all of this sh*t works :-)
2. "Plugins are bad" - IMO this is not true. Illusion, that any reusable code will solve all your domain-related problems is bad. There is several solutions suitable for everything: Turing Machine, Labda Calculus, RAM. Everything else has limits :-) This is why "old" technologies like C or Java are so common in business solutions - they are widely used, so their limits are known. In case of cutting-edge technologies limits = ?
3. Good post! Hope to have them more!
Post a Comment