Re:Applying the Gestalt Principles to Code
by aasasd on Sunday May 05, 2019 @05:01AM
(#19831857)
Tell ya what: for the principle of proximity to be properly implemented, empty lines should be of different height.
[ Parent
| on HN ]
That's how I keep them -- e.g. different number of line breaks between different items (e.g. 2 lines between import statements and class definition, but 1 line between methods inside the class).
That's too crude. What I'm saying is, it should be around 0.5 line height for grouping inside a method, ~1-1.2 between items of a class, 2-2.5 around classes.
Of course, coders' tendency to nest breaks the idea a bit on levels deeper than a method. Though I think with a lot of fiddling some variation can still be achieved.