Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Root73888118dI had a similar issue in Ruby about a year ago.
I can barely remember the details, but I was expecting a data type to be an array, or a hash, or something; not a string. And in Ruby, different classes can support the same methods that behave entirely differently. (Think String’s + vs Int’s + vs Array’s +)
`hash.delete(key)` deletes the key/value pair from the hash.
`”Some string here”.delete(‘string’)` deletes all instances of each of those chars, thereby returning “Some hee”
In a loop, I was cleaning the data using `#delete`, adding in some new data too, joining everything together, etc. I don’t remember the particulars, but everything worked out so there were no crashes. I believe I was getting an error message or other string intended to display to the user instead.
After a few iterations of concating strings and deleting arbitrary chars from the result, you can imagine the data I was getting back. Expect hash, get total nonsense string. It an absolutely head-scratching mess that made zero sense. That was a fun debug session.