5 ms·
This should read "(and where Django doesn't)". A language and a framework are not the same thing. I do not find this article any more compelling than the one i
by teilo 16y ago
This should read "(and where Django doesn't)". A language and a framework are not the same thing.
I do not find this article any more compelling than the one it addresses. Most of these supposed superiorities are just plugins that the author likes that would work just as well in a Python framework, or straw-men. Call it, "Things I like about Ruby/Rails" and were cool. Frame it as "your language sucks" and it all comes off as fanboyism. I like Rails, but Django/Python works the way I do.
Saying that easy_install is "all kinds of broken" but in the next breath saying "Luckily there is Pip and Virtualenv" is a self-defeating argument. As it is, Ruby is well behind pip/virtualenv and the environmental isolation it gives you. And fabric / pip / virtualenv is a killer combo that makes deployment fast and easy. Rails has a Gemfile. pip has a stable-requirements.txt file. It's not rocket science.
Yes, Rake is great. Lots of things Python and Ruby projects can learn from one another. Rails 3 owes a whole lot to Django.
Haml/Sass: Meh. I don't need yet another layer of abstraction. But if I wanted to use these in Python, it would be trivial to do so. To each his own.
ActiveRecord vs Django: Use SQLAlchemy if you don't like the existing alternatives. It supports schema reflection just fine. As it is, lots if not most Django apps are written together with their database schema, and migrated together using South. For most projects, this is identical to how Rails is used.
Form Handling: I can use a ModelForm in Django, and do no mapping whatsoever. Accessing a Post dictionary is just as easy as a magically created attribute on a class. It's not that hard.
Templating: Jinja2 lets me import functions and class instances directly into a template's context, and thus keeps code where it belongs. Talk about religion all you want, but I actually work on projects that need a healthy separation between display and controller logic. Excellent coders that are also excellent designers are so rare that I have never met one. Every successful project I have been involved in has had excellent coders working with excellent designers who knew enough of one another's environments to work well together.
URL routes: Give me Regex any day!
Misc other supposed pluses: Cherry-picking. There are lots and lots of apps to pick and choose from in either platform. Some are good. Some are poor. The existence of a good app on one platform does not equate to a superiority over another platform.
- timmorgan 16y ago"Rails 3 owes a whole lot to Django." Care to elaborate?
- snprbob86 16y agoI think the most obvious one, if not the biggest, is auto-escaping by default. I've started with Rails 3, so I really don't know what has changed.
- kingkilr 16y agoArel's query building syntax appears to be inspired by Django's QuerySets, although there are quite a few other ORMs (and other tools) that use that chaining syntax, so it could be taken from them I suppose.
- teilo 16y agohttp://www.elfsternberg.com/2010/02/03/rails-3-django-funny-syntax/ http://www.elfsternberg.com/2010/02/03/rails-3-django-funny-... "whole" lot is probably overstating it. But some very big key things that make Rails 3 a lot nicer to use.
- steveklabnik 16y ago> Ruby is well behind pip/virtualenv and the environmental isolation it gives you. I'm not a Pythonista, but are you familiar with Bunlder? Is there something that it does that pip/virtualenv would do?
- teilo 16y agoYes. Somewhat different use case, although there is overlap. virtualenv allows you to run multiple Python projects in isolated environments on the same machine, and effortlessly switch between them. These environments are complete in that they contain separate binaries and libraries. They can contain different versions of Python. Virtualenv is not about dependency control and application deployment. It is, however, a part of that solution together with pip and fabric.
- steveklabnik 16y agoAh, okay. So more like rvm, then.
- snprbob86 16y agoI don't think Python sucks at all. On the contrary, I love Python. It is the primary weapon on my scripting utility belt; it will probably continue to be for quite some time. I've used Fabric/Pip/Virtualenv, it required significantly more investment to get up and running. However, those projects are evolving/improving quickly. The Rails Gemfile worked right out of the box. I could address the other points individually, but I guess I'm failing to make my key point: Things just worked better with less effort. Python has a huuuge set of libraries available. Finding the right subset and putting them together effectively is a laborious process. The end result isn't nearly as cleanly integrated as I'd like. Overall, it's a matter of preference. I just found it super interesting that Rails seemed to match my preferences in nearly every layer of the stack. This is coming from someone who was incredibly picky about individual Python libraries. I spent months tuning my stack. But with Rails, I feel like I can just get work done. shrug definitely to each his own.
- jdminhbg 16y ago"Haml/Sass: Meh. I don't need yet another layer of abstraction." Haml isn't a layer of abstraction any more than "1" is a layer of abstraction over "one." It's the same amount of information, just less typing.