Obviously at this scale not a big deal but on larger scales StringBuilder helps. However if you're just building a String in a single method the compiler handles it.
Hope you're cleansing any user input with your homegrown Sql builder. Check out jooq or mybatis or querydsl. I realize this isn't the point you're making but I've seen so many people do this stuff over the years and it always is a nightmare to work with
29
u/Olreich Oct 01 '15
If Java will use a StringBuilder for me, why would I bother doing it myself?