2 ms·
> An empty string being false encourages the poor practice of using empty strings to mean "there is no value here". That is not bad practice, as I said before,
by brabel 2y ago
> An empty string being false encourages the poor practice of using empty strings to mean "there is no value here".
That is not bad practice, as I said before, you almost always want to only process non-empty Strings, but sometimes an empty String comes in from user input or whatever and you either have to check it everywhere like in Java, or in Groovy that is just the default... you can still do 'if (str != null)' to be more explicit, but in my experience that is almost never what you want. Bad practice is making the more usual case look more unusual.
Also, it's nothing like JS because in JS empty lists and maps are `true`! The commonality with Common Lisp is exactly that "not being empty" is what the concept of true represents.