Studies in Computer Sciences and Practices in Software Engineering

Return a Sensible Object

I was writing a function to perform linear interpolation of a list of spectrum:

List LinearInterpolation(List source)

I was tempted to return a null if the source is empty. Then I realized returning an empty list is better. Not only the does not have to check for null return, it also is more elegently in agreement with the input. user

11:58:50 on 12/13/07 by x mar - Category: Programming

Comments

No comments yet

Add Comments

My Links