Re: Why (or not) use single letter variable names?

From: Narasimham (mathma18_at_hotmail.com)
Date: 12/12/04


Date: 12 Dec 2004 09:06:21 -0800

beliavsky@aol.com wrote:
> >Why do mathematicians use single letter variable names (even when
> their
> >work is intended to be read by others) when programmers are
typically
> >taught to use descriptive variable names?

...

> If I am trying to program the Black Scholes formula (for example), >
it is much better for me to
> define a function (in Fortran, for illustration)
>
> real function
> call_price(spot,strike,volatility,time_to_exp,rate,div_yield)
> real :: spot,strike,volatility,time_to_exp,rate,div_yield
> ! some code
> end function call_price
...

I prefer writing a smaller obvious name or abbreviation with a comment
line when necessary. That way it serves twin purposes of brevity and
explanation.



Relevant Pages