This post originated from an RSS feed registered with Python Buzz
by maxim khesin.
Original Post: off-track
Feed Title: python and the web
Feed URL: http://feeds.feedburner.com/PythonAndTheWeb
Feed Description: blog dedicated to python and the networks we live in
So I am going through the Rails book, just because everyone should, to get a better idea of how a simple Web framework in a good language works.
So far I have one specific peeve about Rails that might make developing an app in it a very annoying for me. I admit that this is very personal, and has to do with the fact that I managed to avoid using SQL for most of my career doing image processing+Windoze GUI for 5 very formative years. So I still program SQL on a 1st-grade level.
Rails requires you to define your objects in SQL. Doh. Me not like. Not that I cannot do it, but it makes for an annoying experience.
Here are some reasons why I rationalize my annoyance:
- This setup violates the DRY principle: foreing key qualifier has to be replicated in Rails code vie belongs_to: - Database portability? Switching databases could happen for business reasons; another common practice is using SQLite for development and switching to some heavy SQL in deployment. Having to commit to an SQL flavor up front is going to make this difficult. - Unncesessay syntactic sturggles. VARCHAR NOT NULL WTF? I always have to look little things like this up.
And while the "real" answer to the last point is for me to stop whining and go practice my database skills, why should I ? For small apps that I am interested in and that represent most of Ruby's target audience, simple representation using objects for data and some metaprogramming for data relatonships would be more than sufficient. SQLObject, I'll take 2!