编码实践:您对170万个LOC项目有何想法? [英] Coding Practice: What are your thoughts on a 1.7 Million LOC project?

查看:174
本文介绍了编码实践:您对170万个LOC项目有何想法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在听一个小组讨论,有人提到他们的引擎"不是1.3,但现在是170万行代码.那吓到我了.我无法想象行数,模块数量等等.我一直觉得C ++无法像其他语言一样处理模块.我觉得大型项目更难管理,并且倾向于合理地减少代码行数.当我碰到1万行时,我感到不舒服.我无法想象20k,50k,500k或100万的感觉.

I am listening to a panel discussion where a person mentions their 'engine' is not 1.3 but now is 1.7 million lines of code. That frightens me. I can't imagine that number of lines, the amount of modules, etc. I always felt that C++ doesn't handle modules as well as other languages can. I felt large projects are harder to manage and preferred to reasonably keep lines of code down. I feel discomfort when I hit 10k lines. I can't imagine how 20k, 50k, 500k or 1 million would feel like.

在开发和维护这种规模的项目时,您有什么做法?

What practices do you have while developing and maintaining projects of this size?

推荐答案

一百万行代码已超出大多数凡人可以将其掌握在脑海中的地步.这意味着团队成员将各自携带不完整的系统思维导图,这可能会使设计讨论变得困难.

One million lines of code is past the point that most mortals can keep it all in their heads. That means that team members will each be carrying around incomplete mental maps of the system, which can make design discussions difficult.

为减轻多种不完整的理解,您需要以一组适当的体系结构图的形式绘制地图.这些通常将包括系统体系结构的非常高级的框图,其中包含关键部件的更详细的低级图,以及可能以适当的详细程度描述关键交互的顺序图.在讨论系统时,使这些图表触手可及,有助于团队处于同一页面上".

To mitigate multiple, incomplete understandings, you need maps, in the form of an appropriate set of architectural diagrams. These will usually include a very high-level block diagram of the system's architecture, with more detailed lower-level diagrams for key parts, and possibly sequence diagrams for describing key interactions at an appropriate level of detail. Having such diagrams within reach help the team be "on the same page" when discussing the system.

子系统之间的依赖关系"图还可以指出需要清除的混乱区域(哇?为什么持久性框架的那部分依赖于UI?!?"类型).最好的办法是,如果您能找到一种自动生成这些图的方法. Graphviz可以成为您的朋友.

'Dependencies between subsystems' diagrams can also point out areas of messiness (of the "Wuh? Why is that bit of the persistence framework dependent on the UI?!?" type) that need to be cleaned up. Best if if you can figure out a way to automate the generation of these diagrams. Graphviz can be your friend.

这篇关于编码实践:您对170万个LOC项目有何想法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆