Friday, August 28, 2009

One of my tendencies is to code subexpressions inline if they are only used once. It makes the code less readable by making the lines longer and the expressions more complicated. However, I do it because I don't have to invent some name for the identifier of the subexpression. Furthermore, in Java, if the type of the subexpression isn't already imported, then either the type has to be imported or the full class name needs to be in the declaration.

Decent type inference would move my tendency towards naming the subexpression rather than coding it inline. But the matter of having to come up with a name for it means that my expressions would still tend to be a little more complicated that those written by most others.

No comments:

Post a Comment