11 ms·
How two Pythonistas accidentally fell in love with Rails
- bradleyjoyce 16y agothis is pretty much similar to how I fell in love with Rails... I came from a strictly front-end html/css background.. not too much real programming experience. Ruby just felt so natural and Rails made the hard parts easier and the community was so helpful.
- jnoller 16y agoAnd based on the author's previous Django and ORM posts, I look forward to the next post in a few months when the black magic stops working and they begin to hate on Rails as a framework.
- mbreese 16y agoshh They seem like they are still in the honeymoon period... let them enjoy it.
- FraaJad 16y agoIt must have been a serious accident. The concussion to the brain appears to be pretty severe.
- snprbob86 16y agoshrug I never really had a honeymoon period with any other web framework I've tried, so let's see how long it lasts.
- bmelton 16y agoI had really quite a good one with Django, which clicked to me in a way that Rails never did. I miss scaffolding though, as I think that was the 'killer app' to RAD, but I'm to the point where I feel like even my simpler apps feel constrained by either Rails or Django at this point (though I'm probably just not knowledgeable enough), and have started doing everything with Tornado and SQLAlchemy, which, while they're currently kicking my ass, doesn't give me any sense of constraint whatsoever. Of course, upper bounds have always been something that bothered me, even when they were realistically well about my own limits. When I was learning to play guitar, I went out and bought a Les Paul, for the comfort of knowing that whatever else goes wrong, I can't blame the tool. In reality I know that only poor craftsmen do that, but every time I get stuck trying to remember the 'Django' way to do something, I feel like I'm in a box I want to climb out of. On the whole though, it's quite lovely.
- cubicle67 16y agoyou seem to be keeping good humour considering the number of patronising responses you've received here
- snprbob86 16y agoI firmly believe that if you don't stop laughing, you'll live forever.
- snprbob86 16y agoI'm the author. Yeah, there is a non-zero chance of that happening. However, I keep discovering more and more Rails design choices that either match or closely align with my preferences. The three biggies comparing to Django are: 1) Powerful templates (including the convenience of "Helpers") 2) Non-declarative schema ORM with full migration support 3) Form validation and generation with Rails doesn't suck Lastly, Rails feels battle tested and production ready. Everything from the Rake tasks, to the framework surface area, to the plugins available seems tuned for real applications. Python stacks I have tried often require a lot of hackery to handle server configurations, deployment, content builds, template helpers, ... the list goes on and on.
- andrewingram 16y agoI can't disagree on ORM and templates (I disagree with the lack of proper method invocation in Django templates, it annoys me having to create tags for trivial things). I kind of disagree on the form validation though. Having used a number of frameworks prior to Django (including Rails for about a year), I love the way forms are handled in it - it just seems to make sense to me.
- jnoller 16y agoI think you and I both know - once you've run with something long enough, you hit a wall. Everything - every language, framework or tool hits a wall. You hit yours with Django because you fundamentally disagreed with some of the design decisions. I personally have not hit my wall (with django) but I see plenty of room for improvement. It's awesome you built something so quickly with Rails - I have a similar experience with Django (a tiny amount of time to build a really deep application). I personally found it amusing/bothersome that you were lauding a fairly magical and opinionated framework when you had old posts deriding Django (and it's ORM) in the past.
- snprbob86 16y agoI like opinionated software. Especially when it matches my opinions. And if it doesn't match my opinions, it is easy to dismiss it. It isn't the magic about Django (and it's ORM) that I didn't like. It was the design decisions that didn't match how I think (and approach of declaring the DB schema in code).
- sanderjd 16y agoThis reply could be to the majority of comments on this post, I just chose yours because it's the first one. I'm pretty disappointed with HN being party to the same smug, knowing, tongue-in-cheek Rails (and to a lesser extent, Ruby) hating that you constantly see on Slashdot and elsewhere. There are merits to Rails, and also drawbacks, as there are with every tool. It isn't magic, or anything close - the code is all there for you to read, and it is just Ruby, no pixie dust anywhere.
- modoc 16y agoWhile you aren't wrong regarding the parent comment, I'm actually constantly surprised by how in love with RoR the HN crowd generally seems to be.
- generalk 16y agoWhy? RoR allows lots of HN-types (hackers, people prototyping web business, etc.) to build products quickly. In fact, that's exactly what TFA is an example of. I'm actually constantly surprised at the number of HN readers who seem to hate on RoR out of general principal.
- jacquesm 16y agoTry posting a balanced comment about PHP if you think RoR has a hard time here. Read this and the first comment: http://news.ycombinator.com/item?id=1596505 http://news.ycombinator.com/item?id=1596505 That should give you a good idea.
- generalk 16y agoA lot of the HN crowd dislikes PHP, and can point to dozens of reasons why: no consistency in the standard library re: naming conventions, order of arguments, etc; poor abstractions; up until recent versions, a lack of namespaces or late static binding, and so forth. A lot of the HN crowd seems to dislike Rails, but I've never once seen someone post a objective reason why. Philosophical differences I can see -- maybe Rails isn't for everyone. But the majority of the anti-Rails posts are FUD at worst, and misinformed at best.
- icey 16y agoThis kind of attitude makes me keep looking for ways to move away from Python-land. The new "we're better than everyone else" attitude is seriously grating. I like writing Python, but it sucks seeing this kind of crap every time I go into a mailing list or just about every other public programming forum around.
- kaptainlange 16y ago> The new "we're better than everyone else" He didn't say that at all.
- icey 16y agoI didn't say he did. Reread what I said.
- kaptainlange 16y ago> This kind of attitude makes me keep looking for ways to move away from Python-land. The new "we're better than everyone else" attitude Is this not accusing him of having the "we're better than everyone else" attitude? If not, apologies, but that's what the comment seems to say.
- icey 16y agoYes, he has that attitude. No, he didn't explicitly say that. Those are two different things. There's no point in arguing about it. This is only my opinion, and really I'm nobody; just someone who uses this stuff.
- jnoller 16y agoNo, I don't have that opinion. Look at my history on my blog, or comment history here. Python, Django, etc have plenty to fix and get right. Your facts are wrong.
- 16y ago
- generalk 16y agoI understand that based on the author's previous posts this seems likely, but I'm curious: Is this just snark, or are you familiar with cases where Rails' "black magic" stopped working and caused problems? Because I'm not.
- araneae 16y agoBut I've been resisting it for so long! I can't give in now...
- calloc 16y agoDon't. Give them a month or so to start hating Rails. As soon as you attempt to step outside of what Rails is built for or need some new piece of functionality it starts falling apart, not only that but Rails is painful to scale.
- throwawaypyguy 16y agoyup i agree, look at twitter and then youtube then twitter and then again back at youtube. who scales? Its no wonder when DHH and 37 signal espouse no features philosophy, since implementing them is hard and ruby + rails dont help. You would rarely find any other engineer worth his salt saying that inability to implement a highly requested feature is a virtue and not a failure.
- kingkilr 16y agoYou know youtube is a Python shop right?
- njharman 16y agoThey are contrasting the two.
- generalk 16y agoYou understand that Twitter's issues weren't due to Ruby on Rails, but due to application architecture, right? If Twitter had implemented the same architecture on top of a Python web library, they'd have had the exact same issues.
- eatenbyagrue 16y agoThere's a middle ground of knowledge where this is true... but once you power through to the other side, and understand how Rails works, you can pretty much make it do anything.
- throwawaypyguy 16y agoHmmm, I am some how scared of things that dont reveal their inner working and still let you build on top. Infact a major reason i feel people seem to love NoSQL is not because they have application specific needs which nosql solutions can cater well, but rather they are too bored to actually learn a useful language/system. They just want all the "just works" stuff. This is another reason why ruby seems to be popular with HTML/CSS crowd.
- alinajaf 16y agoAfter having worked with rails for coming on two years now, it's been a love-hate relationship. The short version: your first few apps will be pretty horrible but the more you know about the framework, the better they get. Admittedly, the same could be said about any framework. Also, don't be afraid of the black magic, read the source, its just plain old ruby down there.
- swombat 16y agoAgreed. "Magic" is just another word for "I don't understand how they did this". Whenever you meet "magic", you should dig into the code until you do understand "how they did this".
- nerfhammer 16y agoI think why magic looks like magic is because there is no obvious explanation for what it's doing, e.g. something in rails somewhere is using reflection to pick up something based only on a naming convention. You have to more or less know about the naming convention in advance in order to know where to look up more about what it's doing. I think some people feel like rails went a little overboard on things like this.
- xiongchiamiov 16y agoI think James Bennett's post on magic is interesting: http://www.b-list.org/weblog/2009/jul/23/magic/ http://www.b-list.org/weblog/2009/jul/23/magic/ In particular, there is a comment[0] that I think is particularly worth reading: There are two different definitions of magic in play here. 1. The use of advanced language features in a manner that might be confusing to a novice programmer. 2. The use of ANY language feature to automate some process that a programmer would not expect to be automated. I am of the belief that the second is the proper definition, which is something that is not usually solved by reading sourcecode, as the question is "Why?", rather than "What?" or "How?". [0]: http://www.b-list.org/weblog/2009/jul/23/magic/#c118751 http://www.b-list.org/weblog/2009/jul/23/magic/#c118751
- 16y ago
- 10ren 16y agoORMS: http://blog.brandonbloom.name/2009/10/orms-and-declarative-schemas.html http://blog.brandonbloom.name/2009/10/orms-and-declarative-s... Visual object-relational mappers allow you to integrate different DB schema and classes/objects, instead of deriving one from the other. What do people think of them? They aren't appealing to me, because they aren't very code-like... however, some relationships between disparate type-systems are much easier to express graphically than in code. URL parameters: http://rails.nuvvo.com/lesson/6371-action-controller-parameters http://rails.nuvvo.com/lesson/6371-action-controller-paramet... I really prefer Sinatra's way of doing this; and it's probably even more appropriate for prototyping (but not for big projects, where separate directories help handle complexity.) It's just amazingly simple and intuitive: http://www.sinatrarb.com/intro.html http://www.sinatrarb.com/intro.html get '/hello/:name' do # matches "GET /hello/foo" and "GET /hello/bar" # params[:name] is 'foo' or 'bar' "Hello #{params[:name]}!" end
- jdminhbg 16y agoThat matcher syntax is available in Rails 2, and better and more concise in Rails 3 (http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in-rails-3/ http://www.engineyard.com/blog/2010/the-lowdown-on-routes-in...) match '/hello/:name', :to => 'hello#index'
- okaramian 16y agoI go back and forth with rails. Sometimes the black magic is great, especially if you're trying to rig a prototype together. Also the configuration is almost always really easy so it's not difficult to start burning through a project. Other times it's like "too much framework". I've never really been a fan of the all the javascript hocus pocus that occurs and prefer just writing it out on my own. I also started to get frustrated with the active record query interface and started writing my own queries out because it was faster (for me).
- snprbob86 16y agoThe Javascript hocus pocus is the one key thing I haven't really figured out yet. Rails 3 seems to have made a move to unobtrusive Javascript, but it appears half-baked compared to the RJS stuff I keep stumbling across on the web. If you ignore the `:remote => true` business, it is as if there was no special support for js at all. As a solid jQuery developer, that's probably a good thing.
- cageface 16y agoI stopped using the Rails js stuff a long time ago. It's really not that hard to just use jquery and it's more obvious what's going on.
- deleted 16y ago[deleted]
- andybak 16y agoWow. Very disappointing comments on this post. I was looking forward to a healthy debate with some interesting arguments. but with a couple of exceptions this is silly bickering.
- Raphael_Amiard 16y agoThis may be because nearly everything that has to be said about Django VS Rails, or Rails VS any framework has already been said twice. Not to say there isn't room for new/interesting discussion, but it's certainly a tougher subject than others.
- andybak 16y agoHaving checked back after a night's sleep things seem to have improved. Phew. I thought this had turned into Reddit.
- points 16y agoWhy is this upvoted to #1? There is very little content here.
- swombat 16y agoControversy, I suppose, judging by the comments.
- simplegeek 16y agoWell, I respect your choice. I've been playing with Django for some time. There are things that I don't like and there are things that I like. However, I'm little surprised as to why didn't you try anything beyond Django in Python world, please enlighten me--I'm curious?
- snprbob86 16y agoI have gone beyond Django in the Python world. I tried Pylons, web.py, TurboGears, and a few others. I've built apps on Google App Engine and Paste with my custom "framework" as well as prototyped some stuff with Tornado. My favorites in the Python world are Google App Engine and Tornado (both with my bag of helpers). I like both of them because they are both very practical and embody best practices that I can understand and agree with. Of interesting note, both of them are fairly minimalistic relative to Rails. I thought it was the minimalism that I enjoyed (and to some extent, it is), but in reality it's just that they fit my mental model. Rails fits my mental model and provides loads of convenience. I'm not saying that it is a panacea. I'm saying that I was pleasantly surprised by how much, and in what ways, it differentiated from the Python world.
- mkramlich 16y agoIf you want a Python-based web framework that's super minimalistic and gives you maximum freedom I recommend (re) trying web.py. Just use it for that topmost routing, for example, and the dev web server. You don't necessarily have to use any other aspect of it. I love Django but whenever I have something that I think may cause me non-conformity grief with Django (or any other "big" framework), or, if I just don't have a really solid vision for how the web app will ultimately look feature-wise, I always start with web.py. Then sculpt and pivot to taste, only as needed. It's much easier switching frameworks than languages, in my experience. And being strong in Python buys you leverage in several other areas that Ruby and the Ruby ecosystem is just not as strong in (native lib integration, graphical games, scientific computing, CGI rendering, etc.). IIRC GAE's Python SDK is web.py-inspired. (And Django.)
- pdelgallego 16y agoIf you like Google App Engine, give heroku a try.
- VladRussian 16y ago"Pythonistas"? It sounds like female, plural. In case of 2 males shouldn't it be "Pythonistos"? (anybody with Spanish around?) I mean, i clicked on the link intrigued by promise of [rare] occurrence of female programmers expressing their views on Python vs. Ruby, and read the article somewhat surprised and confused by its tone, style and thought flow - as it was dude's thinking, not gal's :) It is a misleading and deceptive advertising practice :)
- snprbob86 16y agoYeah, I originally thought it was "Pythonist", but some quick Googling corrected me: http://www.google.com/search?q=Pythonista http://www.google.com/search?q=Pythonista
- mikeklaas 16y agoWords that end in -a can refer to both genders, even in latin languages. For instance, 'barista' applies to both men and women in Italy.
- VladRussian 16y agoyes, "-a" would lead to "-as". The "barista" has different origins. The Python case is similar to the widely used "fashionista" for females and "fashionisto" for males in the fasion. Thus it is expected to be "pythonisto" and "pythonistos" for male(s) until there is some gender confusion :)
- pdelgallego 16y agoAFAIK, you can not apply that in Spanish, You should use the masculine plural gender to refer to both genders, or when the gender of the people is unknown. There are exceptions to the rule, like the one above (Zapatistas) or some professions like "doctores" or "jueces", but they are exception not the rule. There are also many words that dont have a feminine plural, i.e "las soldados", "las jueces", etc
- nanairo 16y ago
- mark_l_watson 16y agoGreat developers can get good results with any language and any framework - some tools are just more effective than others for specific tasks. Rails (and specifically Rails 3) is a great DSL/framework for writing web apps and is actually not too difficult to follow if you want to browse the source code.
- zeemonkee 16y agoReally, in startup-land it doesn't make much difference in the greater scheme of things. If you have the right idea at the right time, and can execute well, the framework (or lack thereof) is irrelevant. Use what makes you productive - even if it's just PHP. At the end of the day it comes down to experience and personal preference, unless the project has very specific requirements (needs libary x for example). The only legitimate beef we have as developers is when the choice of tools is not our own. If that bugs you, go and do your own thing.
- code_duck 16y agoRuby is great, but I don't expect to find myself falling in love with Rails say... hmm, 'ever' sounds good. It's about as likely as getting a Windows 7 tattoo on my forehead.
- rohitarondekar 16y agoAt the end of the of the day everybody has their own style and a framework to go with it. Some people leave Rails to do Django and vice versa. One of them just feels natural as compared to the other. Enjoy your preference! <for-everybody-commenting-here> Internals of Rails 3 are much much more simpler and well organized compared to Rails 2.x -- I would seriously recommend getting rid of your fears of "black magic" by diving into the source. :) </for-everybody-commenting-here>