Live data from Hacker News

Ask HN: What should I learn next: Ruby or Python ?

news.ycombinator.com

21–24 of 24 posts

Re: Ask HN: What should I learn next: Ruby or Python ?

#21
post #12

Earlier quoted context omitted.

Django != Python and Rails != Ruby. There are other solutions in either language that might suit your project better.

>There are other solutions in either language that might suit your project better. What I use at work isn't up to me. I'm paid to work, not whine and whinge about the spade in my hand.

Who said anything about whining ? It is your duty as a professional to promote what you consider the best tool for the job. A spade isn't much good if your job is to rake some leaves.

Of course your advice might be overruled for perfectly valid technical or non-technical reasons. But by keeping silent and not suggesting alternatives you are doing yourself and your employer a disservice.

Re: Ask HN: What should I learn next: Ruby or Python ?

#22

Earlier quoted context omitted.

What are your hangups with Django? I've gone through the same so I'm wondering if we are running in to the same kind of issues.

Forms are a fragile waste of time 80% of the time. Only reusable modelforms + generic views really redeem them in my eyes. The ORM is enjoyable but terrible for doing mass migrations. I've had to do some pretty ridiculous backflips just to get migrations to finish on our VPS. The utter lack of real migrations. For. Fuck's. Sake. Makes it impossible to make any rapid changes to your models without thinking, "OH GOD WH…

Absolutely agree with you on most of the points. A couple of quibbles - Django now supports multiple databases (as of 1.2) and South (http://south.aeracode.org/) is more or less the default migration tool nowadays and is OK for most jobs.

Personally, I find generic views to be useless for anything but the simplest of prototyping. Making them functions rather than callable classes was a big mistake IMHO. I very rarely use them in a serious project.

Another pet hate is UserProfiles - you have to use a separate model if you want any custom fields for your users which entails a join whenever you want to use it. It's been a ticket for years but nobody seems willing to fix it.

I agree with you 200% on templates and am in a very similar situation. Having to write convoluted code in template tags for the simplest of things is frustrating, when you can have simple function calls and template macros in Mako and Jinja2.

I'm not hugely fussed about AJAX myself - I tend to keep things simple in the views and just pass JSON back and forth and jQuery does most of the front-end work. I disliked the Rails way of binding everything to a particular JS library, not sure if it's still done that way any more.

Django is OK for certain projects. What annoys me though is that like Rails, it has gotten such mindshare in certain companies that they call themselves "Django shops" and want to use it for everything, without considering alternatives. Personally I stay well clear of it for my own projects - Pylons, Werkzeug, SQLAlchemy et al are a lot more fun to work with.

Re: Ask HN: What should I learn next: Ruby or Python ?

#23

Earlier quoted context omitted.

Forms are a fragile waste of time 80% of the time. Only reusable modelforms + generic views really redeem them in my eyes. The ORM is enjoyable but terrible for doing mass migrations. I've had to do some pretty ridiculous backflips just to get migrations to finish on our VPS. The utter lack of real migrations. For. Fuck's. Sake. Makes it impossible to make any rapid changes to your models without thinking, "OH GOD WH…

Ok. We're on the same track then but I would put it a little more friendly at the moment but I probably haven't got enough experience yet. I spotted werkzeug ('tool' in German) a while ago and it definitely looked very good. I've built 3 sites in Django now, two small ones and one larger one. The small ones worked fine, the larger one Django immediately turned from 'enabler' in to 'straightjacket'. I hand coded the f…

>the larger one Django immediately turned from 'enabler' in to 'straightjacket'.

Yeah, I've had a bit of enlightenment regarding that. I think the trick is to eventually treat it a bit like Philosophy.

Toss aside what you encounter to be a problem, take with you what is useful.

The signals backend and request object encapsulation has proven invaluable, combined with the corpus of snippets and tricks out there.

The templates are really starting to get on my nerves. Probably going to use Jinja2 outside of work here on out.

well, it's been a step-up from what I've experienced because of a perfect storm occurring from the power of combining generic views, quick-n-easy pagination, the ORM, and template inheritance. I've become incredibly productive in Django in spite of the annoyances.

In fact, you may want to check out "annoying django" for some hacks and neat features to deal with some painpoints.

This includes an AJAX view decorator to quickly pass json back and forth.

Re: Ask HN: What should I learn next: Ruby or Python ?

#24
post #22

Earlier quoted context omitted.

Forms are a fragile waste of time 80% of the time. Only reusable modelforms + generic views really redeem them in my eyes. The ORM is enjoyable but terrible for doing mass migrations. I've had to do some pretty ridiculous backflips just to get migrations to finish on our VPS. The utter lack of real migrations. For. Fuck's. Sake. Makes it impossible to make any rapid changes to your models without thinking, "OH GOD WH…

Absolutely agree with you on most of the points. A couple of quibbles - Django now supports multiple databases (as of 1.2) and South ( http://south.aeracode.org/ ) is more or less the default migration tool nowadays and is OK for most jobs. Personally, I find generic views to be useless for anything but the simplest of prototyping. Making them functions rather than callable classes was a big mistake IMHO. I very rare…

>Django now supports multiple databases (as of 1.2) and South

I don't get to use either at work.

I don't really care for SQLAlchemy either.

Post reply on HN