For example, UML or something else ... Sometimes the program is already too long to scroll through it in mind, although it all started with a more or less clear plan, again in mind.

Then in some places crutches went, or the gap of several days between writing and the chain of understanding disappeared.

There are sensations that need to be optimized, but again it is difficult to restore the chain, and inspecting individual sections is not enough, since there are many interconnections.

UML Diagrams I tried earlier on primitive examples, so I don’t know how much they help. I also did not read books on optimization or refactoring, which is probably the problem.

How can we achieve an understanding of the work of the entire program in a visual form?

Closed due to the fact that it is off-topic by the participants Athari , Oceinic , Yuri Glushenkov , Axifive , korytoff on Dec 3 '15 at 20:28 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • " Questionnaires are forbidden on Stack Overflow in Russian . To get an answer, rephrase your question so that it can be given an unambiguously correct answer." - Athari, Oceinic, Yuri Glushenkov, Axifive, korytoff
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • Notebook and pencil. - Nofate ♦
  • 2
    Favorite editor - before writing code, I write code with comments, now often at once and tests. Of course, the usual paper notebook or board has not been canceled. - KoVadim 2:21 pm
  • four
    If it is difficult to restore the logic, you are probably doing something wrong. Break the methods (and classes!) Into small ones that perform the same task, try to get rid of the implicit side effects. Looking at the name of the method, you should understand what it does. Your code should be crystal clear and self-evident, and so that even comments are not needed. - VladD
  • @VladD, if the comments describe what the code does, then you can agree. But comments for what this code (variable) is generally needed - without them, nowhere. Yes, and you shouldn’t rely so much on the "correct" names (and even from long names, it will just ruffle in the eyes and even logically crystal clear code will become unperceivable (as long as you read it, you will forget about it). - avp
  • @avp: From my practice, if a variable requires a name too long to describe, something is wrong with the algorithm . The responsibility of the variable must be described by a simple phrase, otherwise the algorithm must be divided into parts. But I love short functions, YMMV . - VladD

2 answers 2

Top down. At the topmost level, we write those. documentation / specifications. In the documentation, we describe the general device of the system (frontend, scalable backend, open API) and go down to communication protocols between nodes. It should be clear to the new developer without further explanation.

The implementation of the nodes described in each of the independent from each other is clear and transparent due to seemingly competent modularity: common patterns, namespaces, classes, methods. We try to keep the farm in order, everything is laid out on the shelves. If possible, comment on the code. At a minimum, classes, large and inherited methods.

A startup, we are developing rapidly, “there is no time to explain,” everything is far from ideal or even just reliable, but we are keeping afloat, we are connecting new people to the development. Perhaps this is the criterion of clarity - if you can easily introduce new people into the development of the project. Then I myself will be able to figure out the code after a trip to Amsterdam :)

    Hello. Here are some tools for creating flowcharts:

    1. Well-known thing, like a piece of paper and a pencil.
    2. Microsoft Visio
    3. Here is a miracle