Re: Theories on why Lisp source *seems* to have less comments?



Tim X <timx@xxxxxxxxxxxxxxx> writes:

How often do you see something like

x = 10 // set x to 10

Maybe slightly exaggerated, but you get the idea.

One idiom I've seen a lot of in C and C++ -- typical of less mature
programmers -- is the function "plan" left in comment form. The
programmer starts off facing a daunting task by writing a series of
imperative steps as comments:

// Open the file.
// Read each line.
// Does this line start with "cheese"?
// Yes! Let's now try to read what kind of cheese...
// ...
// Close the file.
// Return the result.

The programmer starts filling in code for these steps, usually amidst
the same burgeoning function, and leaves the comments in place --
partly because the smaller steps have not been bundled up in helper
functions. The comments serve as headings to break up the 500-line
mess. It's also frightening to note how often these commented steps go
unimplemented, such as the error cases.

This kind of writing process doesn't work well in Lisp. Perhaps the
initial laying out of steps could be useful, but the code won't settle
in and among the comments as easily. A Lisp author is more likely to
go and create the smaller helper functions, and is more likely to
chain function calls and return values, with the expression tree
growing deeper before it grows wider. The comments get squeezed out,
as they should.

--
Steven E. Harris
.



Relevant Pages

  • Re: Need more info...
    ... Wispy Lisp:= A Lispy Web-framework ... programmer would code in a unified meta-syntax that subsumes ... This data schema determines the legal ... ;; Client action ...
    (comp.lang.lisp)
  • Re: Lisp or Smalltalk for Specific Suicide Mission (er...Project)?
    ... have never had the GOAL of failure or of being a mediocre programmer. ... Please understand that I have not "condemned the community," nor do I ... follow my long meandering posts. ... When I experienced some aspects of the " Lisp culture" that most would ...
    (comp.lang.lisp)
  • Re: [OT] PostLisp, a language experiment
    ... >>latter method in Lisp, and C and many other languages so that the code ... >>the complexity and number of stack items for each definition. ... I do the same thing with my assembly language code, my Java code, my C++ ... >>useless to any experienced Lisp programmer. ...
    (comp.lang.lisp)
  • Re: How Common Lisp sucks
    ... will still leave Lisp a very marginal language, ... "Macros are one of the worst problems with Lisp, ... If you don't write macros, ... C++ programmer, productivity wise. ...
    (comp.lang.lisp)
  • Re: Oft-shared (perhaps?) Impressions of a Lisp Newbie
    ... approach each language without being biased by what I have heard about ... particular strengths and gives me more perspective as a programmer. ... My first glimpse at Lisp came a few weeks ago when I started learning ... GETF is unrelated to SETF. ...
    (comp.lang.lisp)