On Thu, Nov 08, 2018 at 06:13:55PM +0100, Jacob Carlborg via Digitalmars-d-announce 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". > > Someone familiar with the code base might know that the convention is > that a variable of a type inheriting from the Expression class is > usually called "e". Someone new to the code base will most likely not. > I cannot see how starting to call the variable "expression" or > "callExpression" would be disrupt. Currently when someone familiar > with the code base reads the code and sees a variable named "e" the > developer will think "hey, I know by convention that is usual an > expression". If the variable was renamed to "expression" then both the > one familiar and unfamiliar with the code base can immediately read > that this variable holds an expression. [...]
A function parameter named 'expression' is far too long. I wouldn't go as far as calling it 'e', but maybe 'expr' is about as long as I would go. You're dealing with the code of a compiler, 'expr' should be blatantly obvious already that it means "expression". Spelling it out completely just clutters the code and makes it harder to read. T -- Three out of two people have difficulties with fractions. -- Dirk Eddelbuettel