I was just afraid someone would pull some sort of character count argument, so that's why I opted for ZERO, but I fully agree that a more descriptive name is key in producing a more readable (and maintainable) code.
To me the use of 2-2 was clear because I encountered this same problem. And it's for the same reason that I abstracted it away. Should all called functions come to interpret "natural" 0 as an integer in the appropriate context, it will be easy to replace the definition of INTEGERZERO with 0, or altogether replace all instances of the variable with a hardcoded 0 and forget what once needed to be abstracted. Martin Pelletier ----- Original Message ----- From: "Don Guinn" <[email protected]> To: "Programming forum" <[email protected]> Sent: Thursday, October 14, 2010 9:04:39 PM GMT -05:00 US/Canada Eastern Subject: Re: [Jprogramming] wdooo and abstraction Perhaps using a name other than ZERO, like INTEGERZERO or ZERO4BYTES makes it clear what it is supposed to be addresses the documentation issue and makes only one place to fix in case 2-2 gets optimized at a later date. I'm sure a better name could be picked, but using 2-2 is also obscure and optimization may break it in the future. See the questions and discussion it has caused already? Obviously there is a reason why just plane zero won't work. What size integer is needed? 32 bit, 64 bit? 2-2 could result in either, depending on the interpreter. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
