« New Features in the C++ Standard | Main | Fixing the mouse for Debian Unstable and Virtual PC 2007 »

Style optimization is the new premature optimization

Which one of these is better:


  • if (s == String.Empty)

  • if (s == "")

If you think about it long enough, it's almost a Zen Koan. Jeff Atwood believes that the second is clearly preferable, because it is more concise. Numerous commenters weigh in on either side in his responses section.

My own thoughts? It clearly doesn't matter. Programmers whine about premature optimization every chance they get. They haven't gotten the message yet that discussions like this are just as bad.

TrackBack

TrackBack URL for this entry:
http://thras.homeunix.net/cgi-bin/mt/mt-tb.cgi/10

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

About

This page contains a single entry from the blog posted on June 1, 2007 7:55 PM.

The previous post in this blog was New Features in the C++ Standard.

The next post in this blog is Fixing the mouse for Debian Unstable and Virtual PC 2007.

Many more can be found on the main index page or by looking through the archives.

Powered by
Movable Type 3.35