Article View: comp.sys.next.programmer
Article #79Seeking Objective-c prettifier
From: Michael Pizolato
Date: Thu, 29 Oct 1992 21:15
Date: Thu, 29 Oct 1992 21:15
71 lines
2835 bytes
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
Technical Details
Message-ID:
<1992Oct29.211518.1421@afs.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!seismo!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!psinntp!psinntp!afs!michaelShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!seismo!darwin.sura.net!paladin.american.edu!news.univie.ac.at!hp4at!mcsun!sunic!psinntp!psinntp!afs!michael From: Michael_Pizolato@afs.com (Michael Pizolato) Newsgroups: comp.sys.next.programmer,comp.lang.objective-c Subject: Seeking Objective-c prettifier Message-ID: <1992Oct29.211518.1421@afs.com> Date: 29 Oct 92 21:15:18 GMT Sender: michael@afs.com Reply-To: Michael_Pizolato@afs.com Lines: 70