TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Thoughts about Rails from a Django guy

73 点作者 lenni将近 15 年前

9 条评论

samdk将近 15 年前
<p><pre><code> I subscribe to the view that the template language is for designers and should only allow safe constructs. </code></pre> As someone who does both design and programming, I hate template systems that do this with a passion. I don't want to have to learn <i>another</i> language just so I can write templates. Especially when that language makes me jump through hoops to do various simple tasks the designers didn't anticipate--which is the case with every such language I've used.<p>Erb is one of the nicer templating systems I've used. I've never had any trouble getting it to do exactly what I want it to do, and I've never had it behave in a way I didn't expect--which is another advantage to having it just use Ruby.<p>It doesn't have anything on Haml, though.
评论 #1546153 未加载
评论 #1545913 未加载
评论 #1547455 未加载
评论 #1545779 未加载
technoweenie将近 15 年前
The difference between ActiveRecord and Django models, is ActiveRecord <i>reads</i> the schema. When you're developing, having an ORM create tables and add colums willy nilly is fine.<p>DataMapper took this approach initially, and was basically unusable in production because all it could do was create and drop tables. They've since added a handy upgrade method, and even ActiveRecord style migrations.<p>Personally, I like keeping the model and schema separate. I rarely need a giant list of columns at the top of my model. Luckily, Rails 3 will work great with DataMapper or Sequel (two fine alternatives to AR) if that's how you want to roll.
评论 #1545963 未加载
kgrin将近 15 年前
Just like Rails has some drop-in "fixes" (i.e. the admin) that don't come with the core, Django does as well.<p>Dependency management: pip requirements files. Migrations (which the author doesn't like, but are pretty useful on a non-trivial project): South Various other goodies: django-extensions<p>There are constant debates over whether XYZ should be in the core (see: South), or at least better discoverable, but if you're going to use a framework seriously it's worth it to evaluate as "framework + its stable and commonly accepted extras".
grandalf将近 15 年前
Interesting. Both are great frameworks. My thoughts are:<p>I like how django lacks all that directory structure and you can easily use a single file for your models.<p>Django templates are way more powerful and safer than erb / haml, etc.<p>I wish there was a port of django templates in ruby. If so my preferred environment would be sinatra + datamapper + django templates.
评论 #1547088 未加载
评论 #1547236 未加载
matthewcford将近 15 年前
As a full-time Rails developer I think some of these gripes are valid.<p>I have tried to get away from AR for a long time, with other ORMs such as DataMapper or Sequel, and more recently Mongoid. The AR in Rails 3 has adopted some of the good bits from both DM and Sequel, so that might make it more pleasant to work with.<p>In terms of templates, HAML/SASS are popular alternatives to ERB. For the admin backend; there are plugins for it.
micaelwidell将近 15 年前
About two years ago I tried a lot of different frameworks and languages to find which one would suit me best. After having tried various PHP frameworks, J2EE, Perl I arrived at Django/Python. The plan was to continue on to Rails after Django, but I loved Django so much that I couldn't imagine that Rails could be any better. Seems like I was right ;)<p>Like the author, I too think Django's default directory structure doesn't work very well once you start doing bigger projects. But luckily, everything is so loosely coupled that you can change the directory structure entirely without too much work.
评论 #1546394 未加载
评论 #1545762 未加载
评论 #1545980 未加载
评论 #1546165 未加载
metamemetics将近 15 年前
<i>&#62;migrations: I can see how this could come in handy but in my case this was yet another extra thing I had to keep tabs of</i><p>I only use django and have never-not used migrations for a project. Thanks god for South. <a href="http://south.aeracode.org/" rel="nofollow">http://south.aeracode.org/</a>
评论 #1547154 未加载
spooneybarger将近 15 年前
there are drop in admin options for rails similar to what django provides as well as a i massive number of templating engines including ones like liquid which address the concerns in the article.<p>as a general rule, i think you should probably do more than 1 simple project before evaluating any framework or language.
评论 #1546213 未加载
评论 #1545687 未加载
toadytim将近 15 年前
Node.js is changing the game, Ruby and Rails are just the new Cobol.
评论 #1549292 未加载
评论 #1545806 未加载