[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: elegance vs. one-lineness (Was: quick scripting question - finding occurrence in many lines)



On Tue, Nov 07, 2006 at 08:56:55AM -0500, Douglas Tutty wrote:
> On Mon, Nov 06, 2006 at 10:26:53PM -0600, Russell L. Harris wrote:
> > Andrew Sackville-West wrote:
> > >On Mon, Nov 06, 2006 at 01:34:30PM -0800, Steve Lamb wrote:
> > >>    Depends on what you define as elegant.
> > >
> > >when I was learning to program (mid 80's), we considered anything
> > >outside of brute force to be elegant. Also, anything non-obvious was
> > >also considered elegant. Anything that used a side-effect was NOT
> > >considered elegant because you couldn't tell from reading the code
> > >what it was actually doing (one reason I struggle with C). 
> > >
> > >The idea was to be short, sweet, not-brute-forced, and caused one to
> > >say "ah ha!" after a couple read throughs.
> > >
> > >  
> > The ultimate in elegance is Forth.  And the ultimate in Forth, circa 
> > 1980, was polyForth.
> 
> Can you give us an example of Forth, preferably that would do the string
> parse here?

I did a little Forth but remember none except that you started with a
small handful of defined words and a RPN math system and built up
keywords so that the final result to parse this file we've been
discussing would be something like:

(parse IN)

and that is the ultimate in elegance ;-0

A

Attachment: signature.asc
Description: Digital signature


Reply to: