[Mesa-dev] [PATCH v2 01/23] glsl: Add parsing support for multi-stream output in geometry shaders.

Ian Romanick idr at freedesktop.org
Wed Jun 25 11:14:32 PDT 2014


On 06/20/2014 08:17 PM, Timothy Arceri wrote:
> On Fri, 2014-06-20 at 10:46 -0700, Ian Romanick wrote:
> 
>> I care a lot less about "what is often done" than I do about "what
>> should be done".  If there is an argument to be made that stand-alone
>> comments (not on a line with other code) are better, that would be good
>> data to have. 
> 
> Well I'm not sure how common a use case this is for Mesa devs but when
> doing any coding on a laptop the less wasted lines the better.
> Especially when the aspect ratio of all new laptops is suited to
> watching dvds rather than any kind of document viewing/editing.
> I personally do most of my Mesa contributions on the train travelling to
> and from work.
> For the same reason I've always wondered why the preferred width of
> lines is 78 columns? Is this just a historical thing? Or does it make
> sense to use this restriction e.g for debugging in the terminal? The
> devinfo.html doesn't give an actual reason, and 78 columns seems rather
> small considering the size and resolutions of modern screens.

There have been numerous usability studies that show rather conclusively
that it is much easier for humans to read narrower lines of text.  This
is part of the reason newspaper and magazines format text in multiple
columns per page rather than fitting to page width.  For example:

Dyson, M. C. (2004) How physical text layout affects reading from
screen. Behaviour and Information Technology, 23 (6). pp. 377-393. ISSN
1362-3001.

>>  Classically, Mesa has opted for more whitespace because
>> it makes the code easier for humans to parse.  This is part of the
>> reason we don't use //-style comments even in C++ code.
>>
>> I would much rather read
>>
>>         fields[i].sample = qual->flags.q.sample ? 1 : 0;
>>
>>         /* Only save explicitly defined streams in block's field.
>>          */
>>         fields[i].stream = qual->flags.q.explicit_stream ? qual->stream : -1;
>>
>> than
>>
>>         fields[i].sample = qual->flags.q.sample ? 1 : 0;
>>         /* Only save explicitly defined streams in block's field */
>>         fields[i].stream = qual->flags.q.explicit_stream ? qual->stream : -1;
>>
>> I'd also like to hear Brian's opinion, since most of Mesa style is his
>> doing.
> 



More information about the mesa-dev mailing list