4 ms·
My latest comment I wrote was for Ruby legacy code. It was "This method's documentation says it returns a string. That is a lie, it can return an object of any
by maximus-decimus 3y ago
My latest comment I wrote was for Ruby legacy code. It was "This method's documentation says it returns a string. That is a lie, it can return an object of any type."
What's even better than comments, is a compiler that actually guarantees you're gonna be given something of the type you expect.
- soulbadguy 3y agoTo be fair in a weakly/duck typed languages a string can be an object of any type. The fair question to ask would : do those type quack and walk like a string.
- maximus-decimus 3y agoThey don't, it was returning settings from a json file and so was returning booleans, ints and floats.