(Assuming brightness is at no more than 4 bars and bluetooth turned off) 3.5 to 4 hours doing stuff like programming and web browsing; 4.5 hrs if I'm just typing a paper and have my airport off; 3 hrs if I'm doing processor intensive stuff (non-gaming); and 2-2.25 hrs for gaming intensive stuff. I think I may be able to squeeze out battery (I'd say maybe 30 minutes) if I set my processor to reduced and bring my brightness to 1-2 bars.
See my signature for my PowerBook specs.
I'm a programmer (first year computer science this fall 🙂 ) and even though I use Eclipse primarily, I tend to use Xcode rather often as well, and I find no problem programming on Xcode with the 1024x768 screen, just maximize the windows and take advantage of Expose; or you can always just have all the Editor windows inside the Project Window and keep that maximized (this is what I do).
I'd be happy to send you/post up a screen shot of me using Xcode on my PowerBook 12" if you'd like. 🙂