LLVM Coding Standards

spir denis.spir at gmail.com
Tue Apr 12 03:01:53 PDT 2011


On 04/12/2011 12:31 AM, Spacen Jasset wrote:
> I think that people like to follow rules, that is as soon as they have
> internalised them and made them their own. What this means is that they often
> then follow them to a fault, and you get deeply nested, but "structured" code,
> where instead you would be better of with more logically linear code as in the
> case of the early exit. Coding standards should probably just say: try and
> write readable code.

Yes!

> Everyone knows what readable code looks like.

No! It's a cultural issue. In C and C-derived languages, culture favors 
cleverness, complication, & terseness over readability. (Actually, even when 
readable code code is terser.) The key issue is readable code looks *easier*, 
thus it's not that rewarding. Just like what a dancer truelly masters (read: 
with grace) *looks* easy to do.
Readabilty, like simplicity, is *very* difficult to achieve. Designing a 
language that favors readability (and/or simplicity) as well; among other 
points, it requires allowing users express their models by direct analogy (I 
mean the code should somehow mirror the model, its contents & structure, like a 
homomorphism or a metaphor).

Denis
-- 
_________________
vita es estrany
spir.wikidot.com



More information about the Digitalmars-d mailing list