[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua Style Guide ?
- From: Jorge <xxopxe@...>
- Date: Thu, 8 Jun 2017 01:16:00 -0300
On 06/06/17 20:15, Ross Berteig wrote:
I've had my head stuffed in a book design task (using LuaLaTeX)
recently. There really is good rational from book design for shorter
line lengths based on studies of readability of running text. Printers
(the people who handle lead type and spill ink on things) have known
this intuitively about as long as moveable type has existed. The rule
of thumb is that lines of print should be perhaps 45 to 75 characters
long to avoid tracking to the wrong line as one reads. Mitigating that
in code, you have the varying indentation, but generally keeping the
ink to 66 characters more or less is likely easier on the reader.
I read code very differently than books, so I don't think that rationale
translates well. Wen reading book one reads "horizontally", in the sense
that you don't go to the next line until you've reached the end of the
current.
In code, there's both horizontal and vertical reading. It's pretty
common to read a piece of code only reading the first word/few words
across multiple lines. For example, just reading the names of the
functions being called, the variables being updated, or how the
iterators are nested, and only caring about their order and not the
exact parameters (they're obvious) nor the assigned expressions (you do
not understand them anyway :)). This kind of "vertical" reading can be
repeated once and again until I understand what's going on.
So, the vertical structure is at least as important, probably more, as
the horizontal. I usually will gladly compromise on the horizontal
legibility for the sake of the vertical one, because I spend a lot of
time scrolling trough code.
- References:
- Lua Style Guide ?, J Doe
- Re: Lua Style Guide ?, Edu Araújo
- Re: Lua Style Guide ?, Pierre Chapuis
- Re: Lua Style Guide ?, Javier Guerra Giraldez
- Re: Lua Style Guide ?, Sean Conner
- Re: Lua Style Guide ?, nobody
- Re: Lua Style Guide ?, J Doe
- Re: Lua Style Guide ?, Hisham
- Re: Lua Style Guide ?, Russell Haley
- Re: Lua Style Guide ?, Ross Berteig