if you want some values to be optional, then make them optional. All depends on how you put the data in, and how you take it out; easy enough to null-pad, or whatever is relevant to the data type. | [reply] |
If your language says that foo(bar, baz) is defined but foo(bar) is not, then you're unlikely to win the argument with your language. Sometimes you have to work within the rules, not make them.
(Googles.)
My initial response was not quite right, you can have optional arguments in C++ after all. But you can't in Java because the language doesn't support having optional arguments. There to get the same effect you really do have to do function overloading. The overloaded function is pretty easy to write (it just calls foo(bar, baz) with a default value supplied), but you still need to write it.
| [reply] |