home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!oakhill!digital!newsgate!vlsi-az_fw!markp
- From: markp@vlsi-az_fw.vlsi-az.sps.mot.com (Mark Pease)
- Newsgroups: comp.lang.perl
- Subject: Re: Perl language formatting conventions?
- Message-ID: <1992Sep14.171750.7695@newsgate.sps.mot.com>
- Date: 14 Sep 92 17:17:50 GMT
- References: <1992Aug25.152315.20630@news.eng.convex.com> <1992Aug27.042932.3143@netlabs.com> <1361@minya.UUCP>
- Sender: usenet@newsgate.sps.mot.com
- Reply-To: markp@vlsi-az.sps.mot.com (Mark Pease)
- Distribution: comp
- Organization: VLSI Design Center, Tempe AZ
- Lines: 66
- Nntp-Posting-Host: 219.1.111.254
-
- In article <1361@minya.UUCP> jc@minya.UUCP (John Chambers) writes:
- >
- >> I also use 4-space indent, in case you hadn't noticed. :-)
- >
- >It has always seemed to me that a single tab is the best indent. That
- >way, the reader can choose his/her own favorite indent spacing, and
- >everyone is happy. (In vi you type "se ts=4" to get 4-column tabs;
- >most editors have a similar command.) It's also very fast to type.
- >
- >One of the silliest frustrations is all the programmers who like to
- >use mixtures of tabs and spaces to get 4-column spacing with 8-col
- >tabs. This forces readers to reset the tabs to 8 columns to make sense
- >of the code; it is slow for the writer to type; it wastes disk space
- >and network bandwidth. It's about as wrong a convention as one could
- >come up with (so of course it's the most common one ;-).
- >
-
- This happens automagiclly in vi when you have shiftwidth=4 in you .exrc or
- EXINIT, and you use ^T to indent. The programer that does this is not
- (usualy) aware this is even happing! You can get around this by setting sw=8
- or tabstop=4, but *I* don't have a problem with it.
-
- >
- >
- >Actually, my favorite bit of nonsense in C formatting is the growing
- >practice of what I call "Chinese" coding. Recall that traditionally,
- >Chinese was written vertically, with one or two character per line. We
- >are now seeing a lot of C in a similar style:
- >
- > if (!initf)
- > {
- > win =
- > XCreateSimpleWindow(
- > display,
- > RootWindow(display,screen),
- > win_x,win_y,
- > win_w,win_h,
- > border_width,
- > WhitePixel(display,screen),
- > Pixel(display,screen)
- > );
- > initf = TRUE;
- > }
- > else
- > {
- > (void*)
- > fprint(
- > stderr,
- > "%d *** %s can't create new window [%d=%s].\n"
- > timestamp(),
- > progname,
- > errno,
- > sys_errlist[errno]
- > );
- > }
- >
-
- (I) think(that, for_long_lines_that_have_strange, long_names, "Chinese",
- makes_the_line_more_readable);
-
-
-
- Mark Pease markp@vlsi-az.sps.mot.com
- Motorola CODEX VLSI Design Center
- 2710 S Roosevelt St. Mail Stop: AZ28 BB106
- Tempe, AZ 85282 Phone:(602)784-2725 FAX:(602)784-2759
-