Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Forth > Re: paul graham...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 8 Topic 3738 of 4325
Post > Topic >>

Re: paul grahams arc, a new lisp, and his words about makign code

by "Jeff M." <massung@[EMAIL PROTECTED] > Jan 31, 2008 at 11:46 AM

On Jan 31, 12:14 pm, "Robert Miller" <rsmil...@[EMAIL PROTECTED]
> wrote:
> "Jeff M." <mass...@[EMAIL PROTECTED]
> wrote in message
>
>
<news:8975c441-5b74-4a30-906c-d39c96b56e95@[EMAIL PROTECTED]
>...
>
> > I think it's im****tant to distinguish well factored code vs. "compact"
> > code via a language "feature". Both are useful for different things,
> > but "compact" code leads to Perl (left to the reader to decide if
> > that's good or bad). Well factored code can be done in any language,
> > but I find that Forth actively encourages it through negligible
> > performance costs of calling functions.
>
> If you want truly compact code, try APL. Unfortunately, in the case of
APL,
> the compactness came with serious readability issues due in part to its
use
> of a special character set. I believe it was Dijkstra who said something
to
> the effect, 'There is even A Programming Language whose proponents
delight
> in showing their collegues a line of code with the challenge, "You'll
never
> guess what this does"'. (And typically that line of code performed a
> substantial task.)

Sure, but my (perhaps poorly expressed?) point was that compact !=
better, factored == better. Factored code is still brief and many
times more readable. Compact is just brief, and often unreadable. I've
never looked at APL, but I'm curious now. :)

Many times, brevity comes from libraries as well. For example,
consider this example in REBOL:

  send me@[EMAIL PROTECTED]
 "Hello, world!"

That's brief, and does quite a lot of work under the hood. Is it
anything spectacular? Not really, because everyone knows there's
really a ton of code behind it; nothing magical is going on. With a
similar library in Forth I could easily code the same thing:

  s" Hello, world!" email< me@[EMAIL PROTECTED]
> send-email

It's equally brief, just as readable, and there's just as much code
that exists underneath it, making it possible. In the end, stating
that a language is "compact" means nothing by itself. It's either
syntactically compact - typically resulting in write-only code - or
has a large foundation of functionality allowing for a large amount of
work to be done with as few function calls as possible.

Languages like Lisp and Forth are very good for two reasons: first,
they actively encourage factoring in many ways (which ends up leading
to very readable and terse code at the highest level) and second, they
are extensible, meaning if you really need to add syntactic sugar for
brevity/readability, that's possible as well.

Jeff M.
 




 8 Posts in Topic:
Re: paul grahams arc, a new lisp, and his words about makign cod
"Jeff M." <m  2008-01-31 11:46:44 
Re: paul grahams arc, a new lisp, and his words about makign cod
Albert van der Horst <  2008-02-01 11:34:01 
Re: paul grahams arc, a new lisp, and his words about makign cod
"Robert Miller"  2008-02-02 13:58:23 
Re: paul grahams arc, a new lisp, and his words about makign cod
Elizabeth D Rather <er  2008-02-02 10:35:45 
Re: paul grahams arc, a new lisp, and his words about makign cod
"Robert Miller"  2008-02-02 18:25:54 
Re: paul grahams arc, a new lisp, and his words about makign cod
Elizabeth D Rather <er  2008-02-02 14:12:47 
Re: paul grahams arc, a new lisp, and his words about makign cod
"Ed" <nospam  2008-02-08 14:58:46 
Re: paul grahams arc, a new lisp, and his words about makign cod
stephenXXX@[EMAIL PROTECT  2008-02-08 11:23:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 14:23:41 CST 2008.