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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Why I hate Ruby (or at least some common practices of its developers)

13 点作者 prog将近 14 年前

6 条评论

lindvall将近 14 年前
Really? What is it going to take to get beyond the stupid provocative titles?<p>Can we work on being constructive? It would be pretty sweet if people started writing post-mortems for crazy bugs they found the way people write them for outages.<p>What was the process you went through to track down this problem? Were there any interesting tools or processes you employed?<p>What was the final solution?<p>What can we (both you and your team and the community as a whole) do in the future to prevent this sort of thing from happening again?
评论 #2628075 未加载
tung将近 14 年前
Digging around, I found that the author used the JSON gem, relying on to_json taking an optional generator arg. But, yajl-ruby and ActiveSupport define to_json themselves without that, leading to breakage. Those, and the fix for his project[1], are all on GitHub.<p>The author claims most Ruby programmers are monkey-patching and causing these problems. That's almost right: they <i>were</i>. But by and large, they know better now, and would happily replace it with better code, if they could just find it and fix it: that's the real problem.<p>The author could help by, say, logging an issue, or forking and pull requesting a fix. I checked GitHub; his ID, bcoe, doesn't show in the issues, nor in the pull requests of yajl-ruby's GitHub page[2].<p>I'm not saying he <i>must</i> do this for every problem with every open-source project he happens across, but even one contribution helps more than this steam-venting blog post.<p>[1] <a href="https://github.com/bcoe/tire/commit/2dd5fc03" rel="nofollow">https://github.com/bcoe/tire/commit/2dd5fc03</a><p>[2] <a href="https://github.com/brianmario/yajl-ruby" rel="nofollow">https://github.com/brianmario/yajl-ruby</a>
melvinram将近 14 年前
Summary: OP used a gem that depended on other gems, didn't write tests for it and deployed it. This caused problems and he had to go down a rabbit hole which led to a lot of frustration.<p>Snarky response: Duh. Test before you deploy.
评论 #2628119 未加载
rawsyntax将近 14 年前
A better solution for monkey patching is in the works: <a href="http://yehudakatz.com/2010/11/30/ruby-2-0-refinements-in-practice/" rel="nofollow">http://yehudakatz.com/2010/11/30/ruby-2-0-refinements-in-pra...</a><p>That being said, any language feature can be abused and misused
评论 #2628085 未加载
sunkencity将近 14 年前
It doesn't have to be ruby to make it hard to integrate your own frankenstack. Can be just as tricky on Java with different types of dependency injection framework and configuration xmls.
grandalf将近 14 年前
Flagged for linkbait title.