SPUG: Self-generating code: yea or nay?

Marc M. Adkins Marc.M.Adkins at Doorways.org
Fri Aug 9 11:45:38 CDT 2002

I learned Perl after browsing the camel book in Borders and noticing that it
had an eval() function.  It's the first language I've used since Lisp that
has this feature.

I had been playing with Java but reflection didn't do what I wanted...and
all I really wanted was to _easily_ evaluate simple math expressions.  After
learning Perl I found that 95% of the code I had written in Java (on that
particular project) was unecessary if I used Perl.

Granted, mis-use of this feature can lead to performance penalties as well
as being hazardous to one's health (I finally got enough rope to really hang


> Speaking of unstructured coding, I recently updated the online
> grep/map/sort
> tutorial and added the example below.  This got me thinking: are there any
> cases where self-generating code is "better" (in some sense) than the
> alternatives?  I feel the answer is no - can anyone provide a
> counter-example?

 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
      Subscriptions; Email to majordomo at pm.org:  ACTION  LIST  EMAIL
  Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
 For daily traffic, use spug-list for LIST ;  for weekly, spug-list-digest
     Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org

More information about the spug-list mailing list