如何编写图形程序
我学过C++和Qt4。我编写了一个包含 3000 行的图形程序,我发现保持代码简单、透明和结构良好确实很复杂。我喜欢设计模式等,因为它们确实有效并且有助于使代码更简单、更透明。现在我要编写另一个“更大”的应用程序,但我希望有一个清晰的代码,该代码易于编辑,并且添加一些增强功能等不会成为大问题。
我正在寻找一些指南,模式,手册或经验表明,由于业务逻辑和未来编辑中的测试(单元和集成),如何在图形应用程序中构建代码结构良好。
如果本手册针对 C++ 和 Qt 会更好,但这不是主要要求。
感谢您的提示。
I have learned C++ and Qt4. I wrote one graphical program with 3000 rows and I found out that there is really complicated to keep code simple, transparent and well-structured. I like design patterns etc. because they are really effective and helps to keep code simpler and more transparent. Now I am going to write another "bigger" application but I would like to have a clear code which will be easy to edit and won't be big problem to add some enhancement etc.
I am looking for some guide, pattern, manual or experience which says how to structure code in graphical applications to be well-structured due to testing ( unit and integration ) in business logic and future edits.
If this manual will be directed to C++ and Qt it will be better but it is not main requirement.
Thanks for your tips.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我强烈推荐这本书《Code Complete》; http://www.cc2e.com/
I would highly recommend the book, Code Complete; http://www.cc2e.com/
“C++ 编码标准:101 条规则、指南和最佳实践”。
作者:Herb Sutter、Andrei Alexandrescu
这是编码习惯的汇编。非常简短,非常简洁,非常精确,一点也不冗长。这本书对我来说和GoF的《设计模式》一样重要。
"C++ Coding Standards: 101 Rules, Guidelines, And Best Practices".
by Herb Sutter, Andrei Alexandrescu
It is a compilation of coding habits. Really brief, really concise, really precise, and not verbose at all. This book is as much important as GoF "Design Patterns" for me.