home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / postscri / 6471 < prev    next >
Encoding:
Text File  |  1993-01-27  |  2.3 KB  |  60 lines

  1. Newsgroups: comp.lang.postscript
  2. Path: sparky!uunet!ukma!gatech!purdue!mentor.cc.purdue.edu!news
  3. From: ab@nova.cc.purdue.edu (Allen B)
  4. Subject: Re: Is there a PostScript Code Beautifier?
  5. Message-ID: <C1Gv37.6sy@mentor.cc.purdue.edu>
  6. Sender: news@mentor.cc.purdue.edu (USENET News)
  7. Organization: Purdue University
  8. References: <1993Jan26.030632.20615@csus.edu>
  9. Date: Tue, 26 Jan 1993 15:01:54 GMT
  10. Lines: 48
  11.  
  12. In article <1993Jan26.030632.20615@csus.edu> eps@futon.SFSU.EDU (Eric P. Scott)  
  13. writes:
  14. > Gee, I always thought the standard answer was, "follow the style
  15. > used in the Green Book."  :-)
  16.  
  17. Assuming the :-) means what I think it means, yes.  The
  18. Green Book gives some pointers, but I don't think it goes
  19. far enough.  If it did, I don't think I'd see as much ugly
  20. code as I do. 
  21.  
  22. > [ pointer to Adobe's psformat ]
  23.  
  24. Again, my answer was more philosophical, I guess.  The
  25. point of a code beautifier is not to straighten up >your<
  26. code, it's to clean up code written by "those idiots".
  27. It's to format inherently bad code.  You shouldn't need to
  28. reformat code you write, right? :-)
  29.  
  30. The main things that psformat does for you are breaking up
  31. long lines and handling {}s.  You could make emacs do that
  32. if you were good at it.  It doesn't make sure lines end with a
  33. "verb", which I think is important (and tough because
  34. it's semantic).  It doesn't always indent correctly,
  35. even within its limited rules. 
  36.  
  37. I ran a typical "block-formatted" piece of code (my
  38. encode.ps) through it to double-check these
  39. assertions, and found that it's far better than nothing,
  40. but a long way from doing to PostScript what
  41. pretty-printers for other languages do. 
  42.  
  43. Additionally, it made one of my obfuscated PostScript
  44. entries (mm.ps) non-functional- proof enough that I
  45. don't want to use it a lot on alien code.  Even trying hard, I
  46. don't usually write textually ugly code (procedurally,
  47. yes!), imagine what those professional obfuscaters
  48. could cook up. :-) 
  49.  
  50. The problem is a lot harder than it is for languages like C
  51. because we have so little syntax, and because >any< piece
  52. of code could change meaning in another context (if
  53. nothing else, it could be read from the source file as
  54. data).
  55.  
  56. Am I just griping?  No, I'm glad things like this exist, but
  57. I'm still looking for a >real< solution.
  58.  
  59. Allen B (Watching with interest)
  60.