Sujet : Re: Programming Context
De : physfitfreak (at) *nospam* gmail.com (Physfitfreak)
Groupes : comp.os.linux.advocacyDate : 24. Apr 2024, 21:53:43
Autres entêtes
Organisation : Modern Human
Message-ID : <v0bo07$ct8g$2@solani.org>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 4/24/24 06:39, Farley Flud wrote:
Recall that the first written languages, like Chinese, went
up to down, i.e. vertically.
The human brain prefers a vertical orientation when grasping
sections.
When dealing with deeply nested structure, the horizontal indents
will literally start pushing code way off the page. In such
cases vertical indentation is almost mandatory.
Vertical doesn't require comparison with stuff written earlier in the code to sense the grouping, so you have a point there. Makes it faster to read.
In the conventional way, when code groupings takes them too far to the right, it can be remedied by creating a function or a subroutine to shorten the width.
For me, the ideal way has been to use an IDE that separates groups horizontally, but also draws a vertical line to connect the beginning and end statements of each group. There was one and I used it years back, now I don't know which IDE it was. It really helped with eye fatigue that's formed by constantly trying to imagine the groupings without such lines, and only using the relative indentations between them.