Yes. The N900 is the best phone for onboard development by orders of magnitude. No other phone comes close. On native Maemo you have Python, shell (bash), full java JDK, you have C and C++ compilers, etc. And I'm sure there are many more. But then, you can install Easy Debian, and when you do that you will be able to program in any language you can program in on a desktop Debian environment. PLT-Scheme, Lua, etc. You can install multiple versions of Python. You can install Ruby. As a matter of fact, you can install gvim or emacs, and use them as programming environments too. Yeah, the N900 is a programmer's dream come true.
There are at least a dozen threads on the same topic, including guides on how to set it up. I am surprised that the "start a new thread" page did not throw you some suggestions as you were typing the thread title. I would throw you a bunch of links myself if I wasn't typing this on the Jolla which makes thngs like cut'n'paste a bit tricky (N900 is much better). I for one am doing ALL my development for the N900 on the device. The only exception is using Qt Creator on the PC, but only for big changes. For minor alterations I skip that and use Leafpad on the device as well.