如何索引并提供可重用代码?

发布于 2024-07-08 02:45:33 字数 352 浏览 6 评论 0原文

我有很多小文件,其中包含代码片段、伪代码算法、类、模板、SQL 示例等,我显然无法将所有这些放入库中。 我需要一种实用的方法来索引所有这些索引,并能够将该索引提供给其他人。

  1. 这样的索引必须包含什么 让搜索变得最简单?
  2. 有没有这样的存储库 可以在网上找到吗? (所以我可以测试 他们使用的技术。)
  3. 是否已经有任何应用程序 写的实现这个我 可以看看吗?

可能重复:https://stackoverflow.com/q/90300/15161

I have many small files containing code fragments, pseudo-code algorithms, classes, templates, SQL-samples, etc., and I obviously cannot put all these into libraries. I need a practical method to index all of them, and to be able to make this index available to others.

  1. What must such an index contain to
    make searching easiest?
  2. Are there any such repositories
    available on the web? (So I can test
    the techniques they use.)
  3. Are there any applications already
    written that implement this that I
    can have a look at?

Possible duplicate: https://stackoverflow.com/q/90300/15161

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

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

发布评论

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

评论(5

北斗星光 2024-07-15 02:45:33

如果您使用 .NET / Visual Studio,您可以考虑将它们添加为 code snippets

Code Keep 是一个非常好的 CodeSnippets 在线存储库,并且有 VS2008 的

插件我们在工作中所做的工作是创建一个通用帐户供开发人员使用,因此每个人都可以在通用登录名下提交到 codekeep,然后可以检索其他人的代码片段。

此外,在您的开发网络上创建开发人员维基可能是值得的。 老手可以在某个地方留下有关您经常使用的模式和模式的文档。 片段和新团队成员可以查看帮助。 我们在内部使用 TRAC 作为一个 WIKI/问题管理/SVN 集成,它做得很好

If you're working with .NET / Visual Studio, you could look at adding them as code snippets

Code Keep is a pretty good online repo for CodeSnippets and has plugins for VS2008

What we've done at work is created a common account for the dev to use, so everyone submits to codekeep under a common login and then can retrieve everyone elses snippets.

Also it might be worth your while creating a developer wiki on your dev network. Somewhere that the old hands can leave documentation on your regularly used patterns & snippets and new team members can check for help. We use TRAC in house as an all in one WIKI / Issue Management / SVN Integration and it does the job nicely

短暂陪伴 2024-07-15 02:45:33

搜索 StackOverflow 的另一个类似结果:存储代码片段的最佳应用程序

Another similar result from searching StackOverflow: Best Application For Storing Code Snippets

深白境迁sunset 2024-07-15 02:45:33

您可能想尝试 refactormycode.com 或为其设置您自己的 wiki。 维基百科实际上听起来是一个很好的应用程序。

You might want to try refactormycode.com or set up your own wiki for it. A wiki actually sounds like a good application here.

一花一树开 2024-07-15 02:45:33

我发现管理源代码的唯一方法是在源代码控制存储库中。 这包括模板和伪代码算法。
它与您的其余代码有何不同?
我熟悉可以托管的 cvs 例如 这里(设置 cvs 服务器也不是复杂的任务)您可以使用 cvsearch 并使用 cvs Web 客户端 浏览它>.
我并不是说简历是最好的选择,只是另一个可以满足您所有需求的选择。

恕我直言,代码片段不是一个好的选择。

I find the only way to manage source code is in the source control repository. This includes templates and pseudo code algorithms.
How it's different from the rest of your code ?
I'm familiar with cvs that can be hosted for example here (setting up cvs server is not to complex task either) you can search the repository using cvsearch and browse it using cvs web client.
I'm not saying cvs is a best option just another one that fulfill all your need.

Code snippets is a not a good option, IMHO.

过期以后 2024-07-15 02:45:33

您可以使用 哥白尼 Windows Live SearchGoogle 桌面。 然后,每当您想要执行特定操作的代码片段时,只需搜索相关关键字即可。

You can do a full-text index of your hard drive using a tool like Copernic, Windows Live Search, or Google Desktop. Then whenever you want a code snippet that does a specific thing, just search for the relevant keywords and there it goes.

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