home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / shell / 5247 < prev    next >
Encoding:
Internet Message Format  |  1993-01-05  |  1.7 KB

  1. Path: sparky!uunet!psinntp!internet!sbi!zeuswtc!cyclone!bet
  2. From: bet@sbi.com (Bennett Todd @ Salomon Brothers Inc., NY )
  3. Newsgroups: comp.unix.shell
  4. Subject: Re: ksh 1, perl 2 - ksh or perl for scripting?
  5. Message-ID: <801@cyclone.sbi.com>
  6. Date: 5 Jan 93 03:46:12 GMT
  7. References: <1992Dec28.235815.21034@netlabs.com> <1992Dec29.201505.8229@crd.ge.com> <1992Dec31.203724.26018@netlabs.com>
  8. Sender: news@cyclone.sbi.com
  9. Organization: Salomon Brothers, Inc.
  10. Lines: 21
  11.  
  12. Actually, when it comes to clarity of code, I think Perl wins over sh or C,
  13. precisely because there are more ways to do a thing. I try to make code
  14. visually clear [at least to me:-]. I try to adjust the functional
  15. organization and layout of the source code to reflect the logical
  16. description of what it's doing; the more choices I've got in flow-of-control
  17. constructs the better. I find the combination of Perl's named blocks, the
  18. ``next LABEL'' and ``last LABEL'', and the pattern matching against the
  19. default match space $_, to work particularly well for many programs I write.
  20.  
  21. I'm also a big fan of top-down design and bottom-up implementation, and I
  22. find Perl's package system of namespace management to be very comfortable
  23. and natural for the job. I can implement reusable packages to implement the
  24. trickier lower-level functionality, starting with a spec for the interface
  25. to the package. Then I can debug the package with simple test drivers, or
  26. even calling it interactively from ``perl -de 0'' in a JOVE interactive
  27. shell window. Once the package is all set I can use its external entry
  28. points as a new collection of primitives to write the next higher level of
  29. functionality. I've enjoyed good code reuse with this approach.
  30.  
  31. -Bennett
  32. bet@sbi.com
  33.