The other day I trained a new developer and realized that I did not know the actual term "catch" the return value in a variable. For example, consider this pseudo-encoded method:
String updateString(newPart) { string += newPart; return string; }
Suppose this is called to just update a row - no return value is required:
updateString("add this");
Now suppose we want to do something with the return value. We want to change the call so that we can use the updated string. I found that I say "catch the return value", that is, I want to see:
String returnedString = updateString("add this");
So, if you were trying to ask someone to make this change, what terminology would you use? Does this differ in different languages (from a technical point of view, you can call a function or method depending on the language)?
source share