3 ms·
Also, null is not the empty string...
by lukeh 8y ago
Also, null is not the empty string...
- irth 8y agoDepending on how it's used in the Java code, it might be fine to replace it with an empty string.
- coldtea 8y agoHe knows it, that's why he mentions lack of null (nil) in Strings in Go as an issue when porting the code. But depending on how the Java client uses null, "" can do just as well. It's not like you have many other options (except to add your own composite struct on top of String, or to use a guard value that's still a string).
- fileeditview 8y agoIn most cases this would probably be bad but he could also use a pointer to a string.
- IloveHN84 8y agoI hate that everything has 5o be checked against null in Java. It sucks a lot