有哪些选项可以让您的应用程序面向未来进行验证?

发布于 2024-07-18 08:42:27 字数 130 浏览 8 评论 0原文

我正在考虑尽量减少对尚未编写的应用程序的未来影响。 我试图避免任何第三方产品,甚至避免操作系统特定的调用。 任何人都可以建议其他方法来证明应用程序的未来。 这个想法是在 10 或 20 年内不必重写主要部分,并且只需要进行维护(错误修复)。

I am looking at minimizing the future impact on a yet to be written application. I am trying to avoid any 3rd party products, and even avoid operating system specific calls. Can anybody suggest other ways of future proofing the application. The idea would be not having to rewrite major portions in 10 or 20 years, and that only maintenance (bug fixes) would ever need to be done.

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

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

发布评论

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

评论(6

她比我温柔 2024-07-25 08:42:27

如果您希望您的程序在该时间段内继续运行(在现代操作系统上),您可能最终不得不仅使用纯 ANSI C(或 C++)编写它。 其他任何事情都可能需要多年来进行某种调整 - 没有人真正知道未来 10-20 年会发生什么。

也就是说,这里有一些技巧可以最大限度地减少此类问题:

  1. 避免奇怪的依赖关系。 如果您要依赖某个库,请确保它非常成熟(因此可能至少能在这 10-20 年中生存 5 年),或者至少是开源的,这样如果需要的话你可以自己分叉它。
  2. 避免特定于操作系统的调用。 这将是一个平衡行为 1. - 您可以使用包装库,例如 boostQtglib 或what-have-you - 但这会增加这方面出现兼容性问题的机会。
  3. 记录一切。 事实是,无论您多么努力,该程序都需要兼容性修复和错误修复,并且可能还需要添加功能。 因此,让 15 年后出现的那个可怜的维护程序员的生活变得更轻松吧。 :)

If you want your program to keep running (on modern OSes) for that kind of time period, you'll probably end up having to write it in only pure ANSI C (or C++). Anything else is likely to need some kind of tweaking over the years - and nobody really knows what'll happen over the next 10-20 years.

That said, here are a few tips to minimize these kinds of problems:

  1. Avoid weird dependencies. If you're going to depend on some library, make sure it is very well-established (and thus likely to survive at least 5 of those 10-20 years), or at least open-source so you can fork it yourself if need be.
  2. Avoid OS-specific calls. This will be a balancing act with 1. - you can use a wrapper library like boost or Qt or glib or what-have-you - but that would increase the chance for compatibility issues on that front.
  3. Document everything. Fact is, no matter how hard you try, this program will need compatibility fixes and bug fixes, and probably feature additions too. So make life easier on that poor maintenance programmer who comes along 15 years later. :)
原谅过去的我 2024-07-25 08:42:27

挖掘出一些仍然在今天的机器上运行的 10 和 20 年前的程序,看看它们为什么仍然运行以及为什么它们有价值。 我看到许多基于控制台的计算密集型应用程序仍在偶尔使用,大部分是用 C 和 FORTRAN 编写的,由其他应用程序调用。 如果您的应用程序有很多 GUI,您确定它在几十年后仍然具有任何价值吗? 也许可以考虑将用户界面与核心功能分开,这样随着 UI 范例的变化和发展,UI 可以在未来被替换。 如果您以非常模块化的方式编写系统,则可以保留仍然提供价值的模块,而可以替换那些明显过时的模块。

Dig out some 10 and 20 year old programs that still run on todays machines and see why they still run and why they are of value. I see a number of computation intensive console based apps still in occasional use, mostly written in C and FORTRAN, called by other apps. If your app has a lot of GUI, are you sure it will still have any value in a few decades time? Perhaps consider seperating the user interface from the core functionality, in such a way that the UI can be replaced in the future as UI paradigms change and evolve. If you write your system in a very modular fashion, modules that still provide value can be kept while those that are clearly obsolete can be replaced.

南七夏 2024-07-25 08:42:27

编写时请考虑 64 位。 我们现在发现许多第三方依赖项不支持 64 位,因此我们遇到了问题。

Write with 64-bit in mind. We're discovering now that many of our third-party dependencies don't support 64-bit, and so we have issues.

拿命拼未来 2024-07-25 08:42:27

构建 10 年内仍然运行且几乎不需要维护的应用程序的最佳方法是查看 10 年前构建并仍在运行的系统。

根据我的经验,大多数不需要重大升级的系统都是通过在 10 年前部署的相同或相似硬件上运行并使用相同的接口来实现的。

维护人员选择放弃摩尔定律带来的性能改进或可用性改进,转而选择多年来几乎不需要维护。

The best way to build an application that is still functioning with little-to-no maintenance in 10 years is to look at the systems that were built and are still running from 10 years ago.

From my experience, most of those systems, which did not need major upgrades are doing so by running on the same or similar hardware that they were deployed to 10 years ago and use the same interface.

The maintainers chose to trade away the performance improvements due to Moore's law or usability improvements in favor of little to no maintenance over the years.

極樂鬼 2024-07-25 08:42:27

自动化测试也可以提供帮助。
并不是说您的应用程序将得到“验证”,但我会让您知道当情况发生变化时必须修复哪些内容。

Automate Testing can also help.
Not that your application will be "proofed", but I you'll have some idea of what has to be fixed when things changed.

九局 2024-07-25 08:42:27

我开发的许多应用程序都按周期运行(例如:每年)。 为了确保它们继续工作,我所做的最重要的事情不是硬编码日期或日期范围。 示例:

  • year(now()) 表示年份
  • DateSubscribed BETWEENyear(now()) AND DATEADD(year,1,year(now())) 表示某个范围

当然,这些只是例子。

A lot of the applications I develop run on a cycle (example: yearly). The most important thing I do to ensure they continue to work is not hard-coding dates or date ranges. Example:

  • year(now()) for the year
  • DateSubmitted BETWEEN year(now()) AND DATEADD(year,1,year(now())) for a range

Of course, these are just examples.

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