home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / lang / perl / 5925 < prev    next >
Encoding:
Internet Message Format  |  1992-09-14  |  2.8 KB

  1. Path: sparky!uunet!cs.utexas.edu!oakhill!digital!newsgate!vlsi-az_fw!markp
  2. From: markp@vlsi-az_fw.vlsi-az.sps.mot.com (Mark Pease)
  3. Newsgroups: comp.lang.perl
  4. Subject: Re: Perl language formatting conventions?
  5. Message-ID: <1992Sep14.171750.7695@newsgate.sps.mot.com>
  6. Date: 14 Sep 92 17:17:50 GMT
  7. References: <1992Aug25.152315.20630@news.eng.convex.com> <1992Aug27.042932.3143@netlabs.com> <1361@minya.UUCP>
  8. Sender: usenet@newsgate.sps.mot.com
  9. Reply-To: markp@vlsi-az.sps.mot.com (Mark Pease)
  10. Distribution: comp
  11. Organization: VLSI Design Center, Tempe AZ
  12. Lines: 66
  13. Nntp-Posting-Host: 219.1.111.254
  14.  
  15. In article <1361@minya.UUCP> jc@minya.UUCP (John Chambers) writes:
  16. >
  17. >> I also use 4-space indent, in case you hadn't noticed.  :-)
  18. >
  19. >It has always seemed to me that a single tab is the best indent.  That
  20. >way,  the  reader  can choose his/her own favorite indent spacing, and
  21. >everyone is happy.  (In vi you type "se ts=4" to  get  4-column  tabs;
  22. >most editors have a similar command.) It's also very fast to type.
  23. >
  24. >One of the silliest frustrations is all the programmers  who  like  to
  25. >use  mixtures  of  tabs  and spaces to get 4-column spacing with 8-col
  26. >tabs. This forces readers to reset the tabs to 8 columns to make sense
  27. >of  the  code; it is slow for the writer to type; it wastes disk space
  28. >and network bandwidth.  It's about as wrong a convention as one  could
  29. >come up with (so of course it's the most common one ;-).
  30. >
  31.  
  32. This happens automagiclly in vi when you have shiftwidth=4 in you .exrc or
  33. EXINIT, and you use ^T to indent. The programer that does this is not 
  34. (usualy) aware this is even happing! You can get around this by setting sw=8
  35. or tabstop=4, but *I* don't have a problem with it.
  36.  
  37. >
  38. >
  39. >Actually, my favorite bit of nonsense in C formatting is  the  growing
  40. >practice  of what I call "Chinese" coding.  Recall that traditionally,
  41. >Chinese was written vertically, with one or two character per line. We
  42. >are now seeing a lot of C in a similar style:
  43. >
  44. >    if (!initf)
  45. >    {
  46. >        win = 
  47. >        XCreateSimpleWindow(
  48. >            display,
  49. >            RootWindow(display,screen),
  50. >            win_x,win_y,
  51. >            win_w,win_h,
  52. >            border_width,
  53. >            WhitePixel(display,screen),
  54. >            Pixel(display,screen)
  55. >            );
  56. >        initf = TRUE;
  57. >    }
  58. >        else
  59. >    {
  60. >        (void*)
  61. >    fprint(
  62. >        stderr,
  63. >            "%d *** %s can't create new window [%d=%s].\n"
  64. >            timestamp(),
  65. >            progname,
  66. >            errno,
  67. >            sys_errlist[errno]
  68. >        );
  69. >    }
  70. >
  71.  
  72.     (I) think(that, for_long_lines_that_have_strange, long_names, "Chinese",
  73.      makes_the_line_more_readable);
  74.  
  75.  
  76.  
  77. Mark Pease                             markp@vlsi-az.sps.mot.com
  78. Motorola CODEX VLSI Design Center
  79. 2710 S Roosevelt St.                   Mail Stop: AZ28 BB106
  80. Tempe, AZ 85282         Phone:(602)784-2725    FAX:(602)784-2759
  81.