Re: Discuss changing the behaviour of append()
- Posted by jimcbrown (admin) Jun 11, 2014
- 4746 views
One of the better techniques in designing applications, is to always provide validity checking on data that comes from outside the program, as opposed to data that is generated by the program. It would be better, IMO, to validate the text file data before using that data. The application then can either fail gracefully or come to some other arrangement.
Agreed.
Thus from my point of view, I see that my suggested change would not break working programs but would break non-working programs
Agreed in full!
By the way, data that is generated by an application should be subject to 'logic' testing during the testing/debugging stages of an application's development, and not during live run times.
This is a sound principle, but in practice it's hard to think of/catch everything. So those 3 times when there was bad data (and the application crashed?) could easily have been from causes that somehow got missed during the original testing/debugging states, or an "impossible situation" that happened anyways. It happens. Hence the reason to keep validity checking code durning live run times.
I think we can all agree that relying on append() to crash your program for validity checking purposes is a silly way to do things.

