From: Roedy Green on
On Sat, 13 Mar 2010 08:37:09 -0800 (PST), "david.karr"
<davidmichaelkarr(a)gmail.com> wrote, quoted or indirectly quoted
someone who said :

>
> String foo = "";
>
>should instead be:
>
> String foo = StringConstants.EMPTY_STRING;

The first generates almost the same code and is terser.

If it were your money, would you pay programmers to type the longer
form?


--
Roedy Green Canadian Mind Products
http://mindprod.com

Responsible Development is the style of development I aspire to now. It can be summarized by answering the question, �How would I develop if it were my money?� I�m amazed how many theoretical arguments evaporate when faced with this question.
~ Kent Beck (born: 1961 age: 49) , evangelist for extreme programming.
From: Mike Schilling on
Eric Sosman wrote:
> I'll offer one that a colleague once came across
> (in a different programming language):
>
> #define HASHSIZE 51 /* a smallish prime */
>
> The day when compilers can detect this class of error
> is the day when we'll all lose our jobs.

By the time compilers are smart enough to detect this, they'll spend their
mornings hangng around free memory flirting with that cute defragmenter.