Backend nearly entirely converted to D

Neia Neutuladh neia at ikeran.org
Thu Nov 8 18:26:45 UTC 2018


On Thu, 08 Nov 2018 18:13:55 +0100, Jacob Carlborg wrote:
> I guess we have very different ideas on what "small scope" is. For me it
> means around 10 lines. Here's an example in the DMD code base, the
> method for doing the semantic analyze on a call expression [1]. It's 902
> lines long and has a parameter called "exp". Another example, the
> semantic analyze for an is expression [2], 310 lines long. It has a
> parameter called "e".

I recall opening up the source code some years ago, encountering a long 
function, and seeing variables `e` and `e2` that were reused for 
*probably* different purposes but I honestly couldn't tell.

Having them named `expression` and `expression2` would have saved me about 
five seconds total, which wouldn't have been particularly worthwhile. 
Giving them names that reflected how they were being used would have been 
quite helpful -- at the very least, it would have given a weak indication 
that they were not being reused for different purposes.


More information about the Digitalmars-d-announce mailing list