Ruby on Rails:如何处理遗留代码?

发布于 2024-08-15 13:07:32 字数 634 浏览 7 评论 0原文

我有一个用 Rails 1.2.3 构建的门户项目。我在2006年底完成了它。

该项目使用了以下插件: 作为附件的行为 充当雪貂 更好的嵌套集 simple_http_auth

我知道所有插件(或依赖项)今天都已更改,或者不再存在。 DHH 表示:不要高估版本的力量。但我正在担心这个。

如果我更新 Rails 版本,一切都会失败。我可以更改我的应用程序以使用新的 Rails 版本。我想我可以阅读现在已弃用的内容并进行更改。但现在我需要自己支持所有依赖项或将其更改为其他依赖项(例如:acts_as_attachment 到 atachment_fu 或回形针)。明天该说什么?

我的疑问不仅在于 Rails,还在于使用依赖关系来提高生产力。在其他项目中,我使用了纯 Python 代码,甚至纯 Ruby 代码,或纯 Php 代码。今天,我可以在最新版本的“语言/环境”中运行它,而无需(或很少)进行更改。

这些项目没有外部依赖项,只是应用程序代码。也许使用一些 Web 框架作为骨架,但不使用外部项目。

您对此有何看法?

I've a portal project built in Rails 1.2.3. I've finished it at end of 2006.

The project are using the following plug-ins:
acts_as_attachment
acts_as_ferret
betternestedset
simple_http_auth

I know all plug-ins (or dependencies) was changed today, or doesn't exists anymore. The DHH says: Don't overestimate the power of versions. But I'm worrying about this.

If I update the rails version, all things will gonna fail. I can change my application to work with new rails version. I think I can read what's now deprecated and change it. But now I need to support all dependencies by myself or change it to other dependencies (Eg: acts_as_attachment to atachment_fu or paperclip). What to say about tomorrow?

My doubt isn't only about Rails, it's about using dependencies to increase productivity. In other projects I've used pure Python code, or even pure Ruby code, or pure Php code. Today I can run it in latest versions of "language/environment" without (or few) changes.

These projects haven't external dependencies, it's just the application code. Maybe using some web framework just as skeleton, but not external projects.

What do you think about this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

单身狗的梦 2024-08-22 13:07:32

当您使用别人的代码时,您就需要为问题的现成解决方案付出独立性的代价。因此,由你决定在每种情况下什么对你更重要 - 构建你自己的东西并现在浪费时间(可能 - 很多时间),或者使用别人的项目并立即完成工作,但保持与它们绑定,或者用您稍后升级/迁移的时间付费。

你说过这个项目已经为你工作了三年 - 我认为这很棒,如果你需要更新它 - 你自然需要投入一些时间来完成它,三年是一个很长的时间范围这个区域。

When you use someone else's code you pay with your independence for the ready-baked solution for a problem. So it's up to you to decide in each case what's more important to you - build your own stuff and lose time on it now (probably - a lot of time), or use someone else's projects and get the job done right now, but keep tied to them or pay with your time for upgrade/migration later on.

You've said the project worked for you for three years already - and I think it's great, if you need to bring it up to date - it's natural that you have to invest some time to do it, three years is a long timeframe in this area.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文