🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
2 messages
2 total messages Started by Michael Pizolato Thu, 29 Oct 1992 21:15
Seeking Objective-c prettifier
#79
Author: Michael Pizolato
Date: Thu, 29 Oct 1992 21:15
71 lines
2835 bytes
Anyone have or know of an Objective-C prettifier?  I have a NeXT running NeXTSTEP V3.0.  Source code would be nice, but executable only is OK if it lets me customize so that the output looks exactly the way I want it, and if it's not a trojan horse (I trust you, sure I do, I'm only the SA around here :-).  I, of course, have the ultimate program formatting style, which I encourage everyone, everywhere, to adopt because it's so much better than anyone else's ;-), but I need a program to convert other, infer








ior styles to my own so I can read them.  cb(1) is no good - it doesn't place {} or [] pairs where they should be, or allow me to customize anything.  indent(1) is (among other things) no better with {}'s, and it doesn't know // comments, even though it claims to "indent and format Objective-C program source."

Why do most programmers prefer this:

   if (aCondition) {
      aStatement;
      anotherStatement;
   } else {
      yetAnotherStatement;
      yetEvenAnotherStatement;
   }

or this:

   if (aCondition)
   {
      aStatement;
      anotherStatement;
   }
   else
   {
      yetAnotherStatement;
      yetEvenAnotherStatement;
   }

to this (my way):

   if (aCondition)
      {
      aStatement;
      anotherStatement;
      }
   else
      {
      yetAnotherStatement;
      yetEvenAnotherStatement;
      }

Since if/else constructs are defined generically as "if (condition) statement else statement" and anything enclosed in a {} pair is a compound statement (and therefore a _statement_), the third way to me is the most readable, especially when compared with this:

   if (aCondition)
      aStatement;
   else
      {
      anotherStatement;
      yetAnotherStatement;
      }

where both "statements" are indented the same way.  Besides, who could really say they like something like "} else {"?  Not that formatting style is critical to anyone, but readability should be of concern to any shop with more than one programmer, and my way seems to me the most consistent across all possible if/else constructs.

Ya wanna talk about switch statements or nested procedure calls?  Don' get me staaated... ;-)

So, any info on a customizable Objective-C prettifier (with source if possible) will be most appreciated.

Thanx,
Michael

--
Michael_Pizolato@afs.com
~18 kyu
Q16
NeXTMail appreciated
Re: Seeking Objective-c prettifier
#1376
Author: Gary Lang
Date: Sat, 07 Nov 1992 19:12
5 lines
602 bytes
"Anyone have or know of an Objective-C prettifier?"

man indent. It's actually not too bad...

-g
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads