|
On Wed, 29 Dec 2004 14:56:23 +0100, antoine.contal@xxxxxxx <antoine.contal@xxxxxxx> wrote: > > > Alan, > > When you write 'I'm not convinced about the utility of too-long names, or too > many of > them anyway.', you introduce two interesting concepts. > > First, what is too long for a variable? > > This thread's context would suggest the 15-char limit is the boundary between > what's good and what's too long. Why is 15 characters the right limit? Why > not 14? 16? Or 18 if we want a multiple of 3? > > Secondly, you imply quantity may be factor. > > I hadn't thought about that, but you could be right. When people say they > want to prevent long names, they think about programs with many long names. > Then, they start talking about a hard limit that each variable has to abide > to. Yet, maybe > we approach this from the wrong angle. What about a rule stating that 90% of > variables must be within the 15-char limit but the remaining 10% can be > somewhat longer? Wouldn't it be a rule closer to human common sense? > something else to keep in mind is that a constant will 99% of the time be one of a set of values. dayofweek_monday dayofweek_tuesday statuscode_active statuscode_held statuscode_deleted It follows that the constant name should always indicate that relationship. What better way is there than the first half of the name is the name of the constant set, the second half is the name of the constant within that set? You dont have to use the underscore if you dont want to. -Steve
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.