Hi Carlo,
There’s always “vi” on the command line (Applications -> Utilities -> Terminal).
(No, I’m not pulling your leg, I use vi,cat,grep and all sorts of other powerful command line stuff all the time ….)
The GUI app TextEdit can also be used (Applications -> TextEdit).
Otherwise, BBEdit or Textmate.
You might also want to perhaps look at an IDE such as Apple’s XCode, or NetBeans etc.
Good luck, and happy coding !