Q
Q
Quber2019-12-16 10:21:30
Programming
Quber, 2019-12-16 10:21:30

What is the herringbone coding style called?

What is the name of the tree code style when using the fluid interface (example below)? I am interested in the very name of the code design in a similar style. I remember seeing the name before, but I can't remember now.
Example:

$form
    ->tab()
        ->with('Content')
            ->add('title')
            ->add('body')
            ->group()
                 ->add('element')
                 ->add('element')
            ->end()
        ->end()
        ->with('Meta data')
            ->add('category')
        ->end()
    ->end()
 ;

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dollar, 2019-12-16
@dollar

Indents.
More precisely, indents in the chain of methods.
If there is any special name, it is not popular. And by using it, you run the risk of being misunderstood. For example, having said the word "indentation", it is immediately clear what it is about. But the expression "chain of methods", although almost unambiguous, still makes you wonder, because it is rarely used. You can say less unambiguously: "chain of calls", "chain of functions", "sequence of calls", etc., but these expressions are also used with explanations of what they mean. Therefore, you should not look for the correct name, it is better to choose the most understandable for those to whom you want to convey the essence of your thought, and reveal it in other words.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question