[lkml]   [2001]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Coding style - a non-issue (Paul G. Allen)  wrote on 30.11.01 in <>:

> John Kodis wrote:

> > Mathematics has a rich tradition of using short variable names such as
> > "pi" rather than something like "circle-circumference-to-diameter-ratio".
> > They keep formulas from becoming unreadably long, and have a meaning
> > which is well understood in context. While the long version may more
> > self-explainatory, it's the short form which is universally preferred.

> While 'pi', 'e', 'theta', 'phi', etc. are universally understood, things
> like 'i', 'a', and 'idx' are not.

I'd certainly call 'i' well understood in both math and computing. In
math, 'i' is what engineers call 'j' (i*i == -1), and in computing, 'i'
('j', 'k', ...) is a counter for loops (some variant of int) that don't
exceed about a screenful.

> I can use these for anything I want
> and even for more than one thing,

Of course, if you use them differently from what the convention is, *then*
you are in trouble.

> and they say nothing about what they
> are for. 'i', 'j', etc. are fine as loop counters and array indexes
> where their meaning is apparent by context, but are _not_ fine in other
> situations. You (or the person that wrote the code) may think that the
> name is perfectly fine, but someone else that thinks a bit different may
> not.


MfG Kai
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:13    [W:0.340 / U:0.772 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site