littleampton

it's-a-me, me

  • he/him

25 | πŸ‡΅πŸ‡± πŸ§œβ€β™€οΈ | dum dum

☎🧰🎡🐳🌊


littleampton
@littleampton

Gotta love MATLAB using the same names for multiple different functions πŸ™‚


littleampton
@littleampton

I remember how I once spent 30 minutes debugging a nonsensical error after returning to my code after about a month. Trying to call an "isvalid" function, which is supposed to return information whether a "handle" (MATLAB's way of passing by reference) is, well, valid returned an error claiming to require a toolbox, even though I didn't have to install anything before.
After some trial-and-error debugging I realized that the issue was that I passed an uninitialized variable, which in matlab world is an empty array "[ ]".
As the passed argument was not of type "handle", matlab tried to call a completely different "isvalid" function (which was a part of some toolbox I didn't have), because matlab developers seem to take pleasure in reusing function names - how else would you explain the fact that there are 6 "isvalid"s, 1 "isValid" and 3 deprecated "isvalid"s?? Would it be so terrible to call the function "is_handle_valid" instead?


You must log in to comment.