logo

New Response

« Return to the blog entry

You are replying to:

    • avatar
    • axel
    • Posted on Thu 15 Dec 2011 05:13 AM

    just paying back 8 year old debts ;-)

    Using TreeSet saves you just 2 or 3 lines. Not much.

    With a Collection of great size you may gain some performance, but probably its not significant.

    TreeSet documents to those who know the Java Collection framework that sorting is an issue with this collection. This code-as-documentation argument probably is the most powerfull.

    And sadly it defends you against certain breed of "competitive" Java devs.

    This year I dared to use

    ((someString != null) && (someString.trim().length() > 0)) as a not null, not whitespace check.

    This started a 1 hours interogation process, about if I am a "real developer" or some nasty kind of evil impostor as "real developers" out of their very nature use !StringUtils.isNotBlank(someString) from commons-string fame ;-) ... In a project that was long way over budget when I entered.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: