如何快速了解任何产品的设计和代码流? [英] How to understand the design and code flow of any product quickly?

查看:160
本文介绍了如何快速了解任何产品的设计和代码流?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经切换到一家新公司,我正在开发一个没有文档的巨大代码库的产品。我想快速了解产品的设计和代码流程,以便我可能会成为一个有成效的会员ASAP

I have switched to a new company and I am working on a product that has a huge code base without documentation. I want to quickly get acquainted with the design and the code flow of the product so that I may become a productive member ASAP

慢慢地,稳定地了解代码但是,应该采用哪种最好和最聪明的方式来处理代码库,以便他能够快速了解​​代码并开始发布?

Slowly and steadily one does gets to understand the code, but what should be the best and smart way one should approach the code base so that he understands the code quickly and start delivering?

注意:我在Star UML上试过我的手,试图对类图进行逆向工程,以便我对产品内部设计有一个粗略的了解,但是失败了。

Note: I tried my hands on Star UML and tried to reverse engineer the class diagrams so that I may have a rough idea of the product internal designs but failed miserably.

编辑:问题不在于了解产品的功能以及内部设计的方式。

The question is not about gaining knowledge about what the product does but how the internals are designed.

使用断点修正错误和调试确实提供了一个实现这一点的方式,但我正在寻找如果有更快的方式,我们可以实现这个

Fixing bugs and Debugging using breakpoints does provide one way of achieving this but I was looking if there is even a faster way we could achieve this

在Keith的话:


这可能适用于一些代码库,但一般来说我认为它的坏主意你们往往会专注于细节,而首先你想得到一个大的图景:什么是类,通信模式是什么等等。另外,如果你有一个分布式的应用程序(客户端 - 服务器,n层等等)或代码需要很长时间才能运行它可能不实用通过调试器运行

This may work for some code-bases, but in general I think its a bad idea. You tend to be too focused on the details, while at first you want to get the big picture: what the classes are, what the communication patterns are, etc. Plus, if you have a distributed application (client-server, n-tier, etc), or code that takes a long time to run it may not be practical to run it through a debugger


推荐答案

我是一名合约工程师,而且在过去几十年里,这种情况每年都是常规的几次。

I'm a contract engineer, and this situation is routine several times per year—for the last few decades.

我觉得很有帮助首先运行应用程序并使用它,然后查看任何代码:

I find it quite helpful to first run the application and play with it—before looking at any code:


  • 该怎么办?

  • 极端值会发生什么?

  • 如果我省略一些值,该怎么办?

  • 如果我快速点击控件,会发生什么?

  • 有没有办法滥用程序?

  • 应用程序:很少使用或难以找到子菜单?有没有一个配置工具可以展示更多的功能?

  • What the heck does it do? If necessary, read the user documentation.
  • What happens with extreme values?
  • What if I leave out some values?
  • What happens if I click on a control rapidly?
  • Is there any way to misuse the program?
  • Explore the edges of the application: are there seldom used or hard-to-find sub-menus? Is there a configuration facility which exposes more functionality?

在我这样做的时候,我正在构建一个如何会实现它。令人惊讶的是,这种以用户为导向的第一次遇到产品通常会使我对应用程序的理解成为长期以来一直在开发中的开发人员的头和肩膀。这种方法的一个副作用是,我倾向于发现很多错误(通常是他们的雪崩),并且想到应该应该做出很多改进。

While I'm doing that, I'm constructing a mental model of how I would have implemented it. Surprisingly, this user-oriented first encounter with the product usually causes my understanding of the application to be head and shoulders above the developers who have worked on it for a long time. A side effect of this approach is that I tend to find quite a few bugs (often quite an avalanche of them), and think of quite a few improvements which should be made.

之后,我看一下程序的一般结构,无论是模块,类,文件还是模式。 查看各个代码行,除了显示程序体系结构之外。一旦我认为我了解超过一半的结构,我会尝试做一个小错误的修复或改进 - 需要几分钟的时间才能写出来,但可能需要几个小时才能正确理解。如果它有效,我会在某个地方做一个更大的更改,最好在代码的另一部分。

After that, I look at the general structure of the program, whether it be modules, classes, files, or schema. Not looking at individual lines of code, except those showing the program's architecture. Once I think I understand over half of the structure, I try to make a small bug fix or improvement—something which takes a few minutes to write, but may take hours to properly understand. If it works, I make a slightly bigger change somewhere, preferably in another section of the code.

这样,我发现可以很好地理解大约每天50,000到100,000行代码。

In this way, I've found it possible to understand well enough approximately 50,000 to 100,000 lines of code per day.

这篇关于如何快速了解任何产品的设计和代码流?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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