Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> Empty strings are equivalent to null.

No, they are not. Empty strings are completely different from null, and if you go returning them or testing for equality, everything will break by random some single-digit percent of the time. The same for concatenating, taking the length or iterating.

I imagine there's some deterministic procedure to decide what leads to an empty string and what leads to null. The one thing I know is that if you insert it on a table, you will always get null.



Fascinating. Of course it would be too easy if they were strictly the same!

It seems like reading the tale of a greek programmer cursed by the gods to work with madness itself.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: