Suppose you work at a medium-to-large software company with many independently-developed projects (independent coders) but which rely on each other (dependent code).
假设您在一家大中型软件公司工作,该公司拥有许多独立开发的项目(独立编码员),但彼此依赖(依赖代码)。
If it were up to you, would you make sure each project produced stable branches so that the other projects could more reliably use those branches, or would you encourage projects to directly use the latest-available code from other projects?
如果由您决定,您是否会确保每个项目都能生成稳定的分支,以便其他项目可以更可靠地使用这些分支,或者您是否鼓励项目直接使用其他项目中的最新可用代码?
The advantage of a stable release is clear to me - a higher probability that your dependencies will work as advertized. Yet I can also see some good points to avoiding stable releases - each project has a little less work to do, and you can react very quickly to bugs that affect everyone, since your code is sort-of auto-updating all the time. For example, imagine there's a subtle security flaw at timestamp X in one in-house library - it might not be noticed until that code is widely used. If you're using stable release branches, you'll have to get every other project to modify their dependencies to effect the security fix. Without release branches, the fix is picked up immediately in the next build of all other projects.
稳定版本的优势对我来说很明显 - 您的依赖项可能会像广告中那样运行的概率更高。然而,我还可以看到避免稳定版本的一些好处 - 每个项目的工作量都要少一些,而且你可以对影响每个人的bug做出快速反应,因为你的代码总是会自动更新。例如,假设在一个内部库中的时间戳X处存在微妙的安全漏洞 - 在该代码被广泛使用之前可能不会被注意到。如果您正在使用稳定版本分支,则必须让每个其他项目修改其依赖项以实现安全修复。如果没有发布分支,则会在所有其他项目的下一个构建中立即获取修复。
I'm especially interested if anyone has industry experience with both alternatives.
如果有人有两种替代方案的行业经验,我特别感兴趣。
3 个解决方案
#1
3
As always, there are pros and cons for each of the options.
与往常一样,每种选择都有利弊。
Using branches may be more stable but it requires more maintenance when you're required to update to a newer branch. It also requires their development team to spent extra time when the branch is merged with the trunk.
使用分支可能更稳定,但当您需要更新到更新的分支时,需要更多维护。它还要求他们的开发团队在分支与主干合并时花费额外的时间。
On the other hand, using the trunk may force you to deal with other people's bugs and write messy workaround code to get around it. It may get especially messy if you get weird OutOfMemory/Performance issues that can't be pinned to a specific library (or your own code). Remember that this isn't your code, and you probably don't have the manpower to help them with their QA efforts...
另一方面,使用主干可能会迫使您处理其他人的错误并编写凌乱的解决方法代码来绕过它。如果你得到奇怪的OutOfMemory / Performance问题而无法固定到特定的库(或你自己的代码),它可能会变得特别混乱。请记住,这不是您的代码,您可能没有人力来帮助他们进行质量保证工作......
So I guess the final word on this is that it depends. I would suggest taking these factors into consideration:
所以我想最后一句话就是它取决于它。我建议考虑这些因素:
- Is the API you're using going to change?
- Is it important to work on "clean code" or can you allow yourself to mess around with other people's bugs?
- Is it crucial for the application to use the "cutting-edge" version of the libraries?
您正在使用的API会改变吗?
处理“清洁代码”是否很重要,或者你是否可以让自己搞乱其他人的错误?
应用程序使用“尖端”版本的库是否至关重要?
As a side note, and from experience, I can tell you that one of our programmers missed a couple of nights' sleep because he worked with branches and the upgrade to a newer branch changed the entire API and logic. :)
作为旁注,根据经验,我可以告诉你,我们的一个程序员错过了几个晚上的睡眠,因为他与分支机构合作,升级到一个新的分支机构改变了整个API和逻辑。 :)
HTH
#2
2
Think it really breaks down to how mission critical the software is. If you can put up with mild crashing and maybe some data corruption and it's easy to push new builds, running unstable code might be preferred. Now if lives or reputations depend on everything working correctly, or if pushing a new build is a major process, stable tested releases are the only way to go.
认为它真的分解为软件的关键任务。如果你可以忍受轻微的崩溃,也许一些数据损坏并且很容易推送新版本,那么运行不稳定的代码可能是首选。现在,如果生命或声誉取决于一切正常工作,或者推动新构建是一个主要过程,那么稳定的测试版本是唯一的出路。
#3
1
Looking at other projects, it seems to me that the issue that you raise is addressed by having security branches. E.g. Debian packages. That way, you would continue using stable branch across projects. For the reasons you mention, testing / work-in-progress branches carry too much risk.
看看其他项目,在我看来,你提出的问题是通过拥有安全分支来解决的。例如。 Debian包。这样,您将继续在项目中使用稳定分支。由于您提到的原因,测试/在制品分支带来了太多风险。
#1
3
As always, there are pros and cons for each of the options.
与往常一样,每种选择都有利弊。
Using branches may be more stable but it requires more maintenance when you're required to update to a newer branch. It also requires their development team to spent extra time when the branch is merged with the trunk.
使用分支可能更稳定,但当您需要更新到更新的分支时,需要更多维护。它还要求他们的开发团队在分支与主干合并时花费额外的时间。
On the other hand, using the trunk may force you to deal with other people's bugs and write messy workaround code to get around it. It may get especially messy if you get weird OutOfMemory/Performance issues that can't be pinned to a specific library (or your own code). Remember that this isn't your code, and you probably don't have the manpower to help them with their QA efforts...
另一方面,使用主干可能会迫使您处理其他人的错误并编写凌乱的解决方法代码来绕过它。如果你得到奇怪的OutOfMemory / Performance问题而无法固定到特定的库(或你自己的代码),它可能会变得特别混乱。请记住,这不是您的代码,您可能没有人力来帮助他们进行质量保证工作......
So I guess the final word on this is that it depends. I would suggest taking these factors into consideration:
所以我想最后一句话就是它取决于它。我建议考虑这些因素:
- Is the API you're using going to change?
- Is it important to work on "clean code" or can you allow yourself to mess around with other people's bugs?
- Is it crucial for the application to use the "cutting-edge" version of the libraries?
您正在使用的API会改变吗?
处理“清洁代码”是否很重要,或者你是否可以让自己搞乱其他人的错误?
应用程序使用“尖端”版本的库是否至关重要?
As a side note, and from experience, I can tell you that one of our programmers missed a couple of nights' sleep because he worked with branches and the upgrade to a newer branch changed the entire API and logic. :)
作为旁注,根据经验,我可以告诉你,我们的一个程序员错过了几个晚上的睡眠,因为他与分支机构合作,升级到一个新的分支机构改变了整个API和逻辑。 :)
HTH
#2
2
Think it really breaks down to how mission critical the software is. If you can put up with mild crashing and maybe some data corruption and it's easy to push new builds, running unstable code might be preferred. Now if lives or reputations depend on everything working correctly, or if pushing a new build is a major process, stable tested releases are the only way to go.
认为它真的分解为软件的关键任务。如果你可以忍受轻微的崩溃,也许一些数据损坏并且很容易推送新版本,那么运行不稳定的代码可能是首选。现在,如果生命或声誉取决于一切正常工作,或者推动新构建是一个主要过程,那么稳定的测试版本是唯一的出路。
#3
1
Looking at other projects, it seems to me that the issue that you raise is addressed by having security branches. E.g. Debian packages. That way, you would continue using stable branch across projects. For the reasons you mention, testing / work-in-progress branches carry too much risk.
看看其他项目,在我看来,你提出的问题是通过拥有安全分支来解决的。例如。 Debian包。这样,您将继续在项目中使用稳定分支。由于您提到的原因,测试/在制品分支带来了太多风险。