3 ms·
> You don't have to check every every arg to check the count is correct if that's something you're concerned about. Nor does checking args are undefined require
by Peaker 13y ago
> You don't have to check every every arg to check the count is correct if that's something you're concerned about. Nor does checking args are undefined require a line per since you could check them all with a single assert.
That's true, but the overhead is still relatively huge.
> If you're the type who has constant bugs from wrong arg counts, use another language that better suits your programming style, but it's not a problem everyone has
I'm the type of programmer who tries to avoid errors as much as I can, but still make them as I am human, as we all are.
One of the possible errors that's really easy to make is forgetting to grep for callers of a function you just changed. Of course 99 out of 100 times you remember, but 1 out of 100 you will forget.
Another possible error is remembering to change the function signature, but just having a typo or mistake.
And finally, even if you make no errors at all -- when you pull from the server you get a bunch of function signatures and calls changed "under you feet", so any changes you had already pending (perhaps in different files) are now potentially silently invalidated, and there won't even be a runtime error to tell you about them.
There is really no real benefit to this behavior at all (beyond backwards compatibility of course). Explicit rest-of-args cost nothing.
Error messages are superior to wrong behavior, and this behavior is simply insane.