Many many years ago I learned Delphi language. It has one interesting feature not found in other languages: you don’t need return statement to specify return value for a function. Instead, you can use a pseudo-variable called Result. You can change its value many times during function execution but only the last value is returned.
That’s really a great idea! Even if your programming language doesn’t have such a built-in variable, why not to create it?
Most functions actually need a variable to forge future return value, so why call it differently if we can always call it result?
Read the rest of this entry »