From Python to Ruby: Mind Blown by Rails, the Framework
gist.github.com
gist.github.com
It's pretty damn awesome to spend all day writing business code rather than support code.
One-thousand times this. I've had some headaches with gems (chronicled earlier), but if you're building an app with minimal add-on gems then development speed is incredibly fast compared to other frameworks.
It's fun to see you chronicle your journeys from the perspective of someone totally new to the language and framework. Please keep it up.
Ruby seems to be an anomaly in that you can pretty much obscure away the hard parts of building a web application, but have it still be programming. If a programmer starts with Rails, does that impact their ability to eventually go on to other things?
The real reason rails generators work so nicely is that most of the components are known. MS pushes entity framework hard, but it isn't included by default. If you don't know what IOC is being used you cannot generate a controller. If you don't know the ORM, you cannot generate a model. Don't even get me started on the fact that most of the community doesn't even use either of those two.
Where did you get stumped with Django?
I use Django to do all kinds of "non-traditional" stuff (key-based API authentication, automatic object-level caching, custom form fields, using Postgres features such as UUID fields and fulltext search) and none of it took me that much work. But then, I've been using Django for a few years now and know the ins and outs quite well.
I can see how you'd be enticed by a simpler framework such as webapp2 or Flask as a starting point. But I've found that Django is as flexible if you just consider that most of the built-in features that Django provides (even the awesome ORM) are optional if you know what apps and middleware to disable.
And when I was learning Django, I didn't know this. I moved to webapp2 because I could put only what I wanted in an application. I'm sure that if I sat down and re-dedicated myself to learning Django like I'm doing with Rails, I might have a better time at it the second go-around.
I, personally, used to do it all by myself as a PHP developer, where I wrote raw sql queries and handled the raw HTTP request. Once I figured out ORM in django and its custom templating system, everything becomes so much less code and easy to implement.
There should probably be a chapter on the tutorial with a simplified version of that. It'd help newcomers understand where everything fits.
In any case, I'm glad you found a tool that does what you need as long as it isn't written in PHP :P
[1] http://www.b-list.org/weblog/2006/jun/13/how-django-processe...
Nothing in that logic adds up. And for the record, I've yet to do a "traditional" web app in Django. Having taken the time to learn it inside and out I get all the benefits of flexibility that I would with something like Flask/webapp2, but retain the convention and mindshare for the rest of the project that does fit into common usecases.
I could write much of the same post and have it apply to Django as well. Django is designed to abstract away work, which means that it's difficult to really see what your application should be doing if you don't already know. If you've learned how to manage user authentication manually, you can appreciate and tweak what Django/Rails are doing. If your first experience with a web framework is having Django manage all of that for you, then you have no idea how to tweak it or debug it.
Ultimately, this is not a Django versus Rails debate - I just used my current Rails experience and prior Django experience as anecdote. I can't claim enough knowledge of Django or Rails to even advise someone on which to learn; all I can do is talk about my own experience and raise questions.
i felt like i had much more control and the admin section really sold me.
rails always felt a bit "too magical" for me. I could get anything done, but I didn't know why or how. I didn't feel like I was getting much better as a programmer. With Python, I felt like I was getting better after the first day.
One of my biggest annoyances though is the really REALLY hard upgrades between different Rails versions. 2.x to 3.x was several days project including testing etc. 3.0 to 3.1 or 3.2 adds the nice assets pipeline, which of course might brake some javascript if you have lots of legacy there.
A minor change in ActiveRecord (and minor Rails upgrade) changed the behaviour to use SHOW INDEX instead of describe before loading data. The result was hazardous. So when you start to have lots of traffic, be very careful when upgrading Rails itself. And read the changelogs and the diffs.
What I've learned with rails is that the minor version you start a project with should stay the same for the sake of your sanity, until after project completion. Concerning yourself with incremental improvements should be avoided until you are between major versions of your own codebase.
I must admit that Ruby on Rails was the first web framework I learned. Since then, I have dabbled with Python's Django, PHP's CakePHP and even Express on Node.js. What I tend to find is that other MVC web frameworks seem to be imitating Rails - so rather than use a follower I just stuck with the leader, Ruby on Rails. Until there is a much better alternative (looking at you Meteor/Node.js frameworks) I will be a happy Rails dev.
Web2py has its faults but in terms of "speed" as defined by op, it is considerably "faster" and with almost no boilerplate/scaffolding.
You quickly end up having to push the boundaries of what scaffolds can do for you as you work on the finer details of a project.
I'd also like to give credit to bundler for making my life simple and saving me from dependency hell. It was a life altering experience coming from .jar file management to meet the magic of bundler.
It's amazing to have one of these. But it's even more amazing to code one yourself. Everyone should do it.
Right now I want a Lua Rails like framework (I'm always interested in raw machine performance).
It seems Orbit (http://keplerproject.github.com/orbit/) is what I am looking for.
I eventually jumped to doing more webapp2, and I know there's a devout Flask community as a Django alternative. Haven't played with enough Flask to say anything yea or nay for beginners, though.
What would be an example of something you encountered with django that required getting creative quickly, that rails handles more routinely?
For me, the trickiest thing in either ecosystem to get a handle on was probably rspec. I tried to learn it by osmosis and that was probably the wrong way to go. In the end, it's worth having a DSL for writing tests and leads to nice clean readable code.
When people are trying to learn rails, I point them to Rails 3 in Action and Michael Hartl's online tutorial, but still need a better reference for learning rspec. suggestions are appreciated.
Really? Tell me where the Flask community is.
I actually regretted my decision of choosing Flask over Django after 2 months of working with it precisely for that very reason.
You can find tons and tons of tutorials, docs, writings about best practices from others, crowded IRC discussions, etc. for Django -- not so for Flask. But maybe I'm mistaken? I'd love it if you clue me in as to where all the Flask people are hiding.
On the other hand, Django's 'batteries included' philosophy means you can deploy a generic CMS application very quickly.
Maybe there should be a second option "barebones" that created a settings file with most features disabled by default (yes, even the Admin.) Users who just needed a simple WSGI-compliant framework could start from there instead of figuring out what stuff to disable. You'd basically be on pair with Flask, with the advantage of having access to the advanced features just by dropping stuff in your INSTALLED_APPS and MIDDLEWARE_CLASSES settings.
Now you know why. A lot of people zeroed in on your admiration of scaffolds - I really liked scaffolds when I first started out too, but I don't use them very much anymore. The other features of Rails that you will eventually discover are equally fantastic, and much less controversial