Backend nearly entirely converted to D

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Nov 7 22:08:36 UTC 2018


On Wed, Nov 07, 2018 at 09:49:41PM +0000, welkam via Digitalmars-d-announce wrote:
[...]
> One of biggest and needless hurdle I face in reading DMD code is
> single letter variable name. If I change one letter variable names to
> more descriptive ones would that patch be welcomed or considered
> needless change?

I don't speak for the compiler devs, but IMO, one-letter variables are
OK if they are local, and cover a relatively small scope.  Java-style
verbosity IMO makes code *harder* to read because the verbosity gets in
your face, crowding out the more interesting (and important) larger
picture of code structure.

As Walter said in his recent talk, the length of variable names (or
identifiers in general, really) should roughly correspond to their
scope: local variable names ought to be concise, but global variables
ought to be verbose (both to avoid identifier collision when a larger
amount of code is concerned, and also to serve as a convenient visual
indication that yes it's a global).


T

-- 
An imaginary friend squared is a real enemy.


More information about the Digitalmars-d-announce mailing list