2 ms·
Ok, I’ll bite back. Yes, “StringUtils.isEmpty” is materially worse, in every way. It’s not really any more readable: the first time you see it, you ought to c
by commandlinefan 7y ago
Ok, I’ll bite back. Yes, “StringUtils.isEmpty” is materially worse, in every way. It’s not really any more readable: the first time you see it, you ought to check to make sure that is just checking to see if the pointer is non-null and the string is 0-length to make sure that it’s not doing something else, like trimming whitespace, which you may not want. You’re adding a few hundred kilobytes of dependency plus an extra unnecessary function call, just to make it less clear what your program is doing. If you use static imports, it’s even less readable because it’s not at all clear where this mystery function came from: I hope you’re lucky enough to be able to import this code into an IDE and click-through the function to see what it is and what it does. Maybe if it was just this one function it wouldn’t be so bad, but this bit of pointlessness ends up scattered everywhere.