December 28, 20223 yr Over the years I saw in some answers that the use of an arbitrary high number [like in calculations] could not be a good practice. Why not? What could/should be the alternative? While I see in several custom functions the use of it.... Any example of the use of an alternative would be welcome.
December 28, 20223 yr A calculation is supposed to implement the logic prescribed by the business rules set for the application. When a calculation uses an arbitrary limit - i.e. a limit not prescribed by the business rules - then it fails to express correctly the required logic. This has two potentially harmful effects: the limit is arbitrary, therefore confusing to the person reading the code; the limit can be exceeded in some unforeseen circumstances. In some cases a very high limit could also increase the time required to process the calculation. 3 hours ago, Montana50 said: Any example of the use of an alternative would be welcome. A classic example is: MiddleValues ( listOfValues ; 2 ; 999999999999999 ) The intent here is to remove the first value from listOfValues - which could be easily accomplished by: MiddleValues ( listOfValues ; 2 ; ValueCount ( listOfValues ) ) or even better: RightValues ( listOfValues ; ValueCount ( listOfValues ) - 1 ) But the author was too ignorant or too lazy for that. As a result, the person reading the code started a post here asking: Quote I am trying to figure out what the "999999999999999" is doing here in this partial script please
Create an account or sign in to comment