Variable or pattern name for method arguments as both input and output parameter

20 Views Asked by At

When I have an ecryption method parameter that acts as an input and output parameter, is there a convention on how to name such parameters? Or, more general, when I have a method that completely rewrites the content of an argument, is there a convention? Or is there a name for this pattern?

The name or pattern should

  • either represent the fact that the variable contains unencrypted content before and encrypted content after the call
  • or, more general, make it obvious that the method will put its result into the parameter, which will have different content afterwards -- the content will not be slightly altered, but completely rewritten.

Compare to Botan::Cipher_Mode::finish() https://botan.randombit.net/doxygen/classBotan_1_1Cipher__Mode.html they just call the method final_block and explain final_block in/out parameter which must be [...].

I only came up with in_out, but this is not really satisfying.

0

There are 0 best solutions below