0

Possible Duplicate:
Objective-C style formatter

I have wrote a program and wonder if there is any software to format the codes the way it should look like a good programmer?

I know I shouldn't rely on it but just for my curiosity and to have this done in a better way because my code it so mess up and I want it look nicer and better.

On mac would be appreciated if not PC would be okay.

Community
  • 1
  • 1
Ali
  • 9,997
  • 20
  • 70
  • 105
  • 2
    Can you explain what you're after in more detail? What do you want this software to do? – Michael Petrotta Feb 27 '12 at 01:21
  • 2
    There's no software that will make you a better programmer (unless it's an ebook reader program with an O'Reilly book open in it...). Are you asking for a code *formatting* tool? – Borealid Feb 27 '12 at 01:22
  • @MichaelPetrotta sorry I didn't explain it well, I've wrote a program but my indentation is so mess up and I want it to look better the way a good programmer should manage it. – Ali Feb 27 '12 at 01:24
  • 1
    @Borealid really sorry for my bad English, that's what I meant for code formatting tool. – Ali Feb 27 '12 at 01:25

3 Answers3

5

If you're using XCode, you can re-indent your files (Editor -> Structure -> Re-Indent), or with the keyboard shortcut: ControlI.

simont
  • 68,704
  • 18
  • 117
  • 136
4

One nice code formatter is astyle. The download link can be found here. And I just checked, they support Mac as well.

SCFrench
  • 8,244
  • 2
  • 31
  • 61
1

There's the command-line program indent, which does not do complete style formatting but does get indentation sorted out for you. indent should come with your Mac (or maybe it comes with Xcode? not sure). See man indent.

zmccord
  • 2,398
  • 1
  • 18
  • 14