Hacker News new | past | comments | ask | show | jobs | submit login

Curi is on to something here. For a period of a couple years I was TA for an intro to programming course using Scheme. One of the questions we always asked students was about the advantage of certain refactoring styles, to which half of the answer was "giving names to things." One of the great powers of Lisp is that the path of least resistance is to write many small expressions where each one must have a name, even just an iteration over a collection. This is great because we always know what operation we're doing. There is the same type of power in imperative languages to a lesser degree, but it manifests in naming data. The path of least resistance in C-like languages, BASIC, and P languages encourages having named accumulators and containers (writing lots of chained expressions creates code that's more concise but less readable). This is great because we always know what we're operating on.

The flexibility of Lisp probably makes it more suited to adapting to encourage naming data, over imperative languages encouraging MSFs. let/let* is a little clunky for simple things -- it reminds me a little of Pascal's variable declaration blocks. It would be better to do a sort of: (lambda (a b) (A <- foo a) (B <- bar A b) (Z <- baz B) Z) or optionally (return Z) instead of just Z, which macros to (lambda (a b) (baz (bar (foo a) b))))

It seems like the sort of thing that someone would already have implemented, but I don't recall it being a core feature anywhere.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: