良好的 C++ 开源代码
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4324169/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Good open source code for C++
提问by Dimitri
I have had a course on C++ and have done some minor projects on implementing data structures in C++. Can I find a not-so-difficult good open source C++ project that follows good programming styles. I want to have an understanding of a real project.
我上过一门关于 C++ 的课程,并做了一些关于用 C++ 实现数据结构的小项目。我能找到一个遵循良好编程风格的不那么困难的优秀开源 C++ 项目吗?我想了解一个真实的项目。
回答by haylem
Search on Google Code Project Hostingor SourceForge, or even better still, do a search for C++ projects on Ohloh. Unfortunately you cannot do searches on code quality, but at least you can see a report on the projects page to find some with good quality metrics and relatively small codebases.
在Google Code Project Hosting或 SourceForge 上搜索,或者更好的是,在 Ohloh 上搜索 C++ 项目。不幸的是,您无法对代码质量进行搜索,但至少您可以在项目页面上看到一份报告,以找到一些具有良好质量指标和相对较小代码库的报告。
Some projects that I've come across with good code quality and in c++:
我遇到的一些代码质量很好的 C++ 项目:
- Relatively small codebase:
- Not that easy to get into:
- Never really looked at but could be interesting:
More importantly, just look around and see if a software you like and use often is developed in C++. You'll have a greater incentive to contribute and to see your changes in real-life and used by others.
更重要的是,环顾四周,看看你喜欢和经常使用的软件是否是用 C++ 开发的。您将有更大的动力去贡献并看到您在现实生活中的变化并被他人使用。
You may also want to refer yourself to these other SO questions:
您可能还想参考这些其他 SO 问题:
回答by push рор
If you are looking for small but powerful project I recomend you DGLE- minimalistic, cross-platform, multi-render(OpenGL, DirectX) graphic engine with plugin based architectire wrtitten in modern C++. Unlike similar projects it only takes about 20-30 files. Also developers regularly updates sources to accomodate C++11/14/17...
如果您正在寻找小而强大的项目,我向您推荐DGLE- 简约、跨平台、多渲染(OpenGL、DirectX)图形引擎,带有基于插件的架构,以现代 C++ 编写。与类似项目不同,它只需要大约 20-30 个文件。开发人员还定期更新源代码以适应 C++11/14/17...
回答by Grokwik
I would recommend source code produced by fsf teams such as Ubuntu (for example), as far as i know they are quite strict on the source code provided.
我会推荐 fsf 团队制作的源代码,例如 Ubuntu(例如),据我所知,他们对提供的源代码非常严格。
回答by sarat
Coding Style will be different from one project to other as usually they've set of guidelines and design principle for the project. I suggest you to go some sites, like codeproject.com and see the small open source projects out there. If you still need high quality code, I'd suggest you to go for some famous code like
编码风格会因项目而异,因为通常他们为项目制定了一套指导方针和设计原则。我建议你去一些网站,比如 codeproject.com,看看那里的小型开源项目。如果您仍然需要高质量的代码,我建议您使用一些著名的代码,例如
- Filezilla
- Notepad++
- Google Chrome
- Mozilla Firefox.
- 档案馆
- 记事本++
- 谷歌浏览器
- 火狐浏览器。
You can see truly high quality code in http://sourceforge.net/Go for popular apps.
您可以在http://sourceforge.net/ 中看到真正高质量的代码,用于流行的应用程序。
But you've to notice one thing that, most of the people who works for open source project will surely write highly optimized code. It might be a bit difficult to understand that.
但是你必须注意到一件事,大多数为开源项目工作的人肯定会编写高度优化的代码。可能有点难以理解。
Though I suggested Firefox and Chrome, those are really huge to understand in single shot. I'd suggest you to read the articles from some good programming websites. At the same time, I'd suggest you to read following books - Code Complete 2 - Effective C++ - C++ FAQs
虽然我建议使用 Firefox 和 Chrome,但这些都非常适合一次性理解。我建议你阅读一些好的编程网站上的文章。同时,我建议你阅读以下书籍 - Code Complete 2 - Effective C++ - C++ FAQs
回答by Schwern
Dungeon Crawl Stone Souphas an excellent, large, Open Source code basewith a large community of code contributors. Everything is well named and well factored into classes, methods and files. It even covers language translations. It has excellent instructions for how to contribute. And it's a great game!
Dungeon Crawl Stone Soup拥有一个优秀的大型开源代码库,拥有大量代码贡献者社区。一切都被很好地命名并很好地分解到类、方法和文件中。它甚至包括语言翻译。它对如何贡献有很好的说明。这是一场伟大的比赛!
If there's one flaw there is no API documentation, but quite honestly it is so well named and factored you can figure it all out quite easily.
如果存在一个缺陷,则没有 API 文档,但老实说,它的命名和分解非常好,您可以很容易地弄清楚。