RE: emacs...
Okay, I know I'm an antediluvian troglodyte, as my progeny always love to point out to me, but I'll add my two cents here and suggest "emacs" or its Aqua version "aquamacs" (emacs comes with Mac OS X and aquamacs is free).
Emacs is, in my humble opinion, the most powerful and flexible of all editors. You can do almost anything in emacs, not only writing and testing code in most any programming language natively, but also editing 10000 files automatically with a single line of emacs elisp code...
Okay, you may go ahead and make fun of me now ... I give you my permission.
Regards,
Switon
P.S. Barring emacs, then I agree TextWrangler is nice...