lua-users home
lua-l archive

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

On Thu, Jun 7, 2012 at 2:06 PM, joao lobato <> wrote:
> Yes, I can see why method chaining seems easier to follow when reading
> code, but it is in contravention of [1] and I don't want to be stopped
> by the police :-) .

Well, the Thought Police tend to work according to the letter, not the
spirit, of the law.

A very successful implementation pattern has been pipelining (classic
Unix style) and method chaining works like that; one applies
processors to a stream of data (and that data can be strict as it
likes about sharing its secrets).

> Things like list comprehensions, pattern matching as it exists in
> Haskell or Erlang,

I see them as implementation patterns [1], not for composing large
software systems. Modules should still be minimally coupled, and do
their one thing well. We would all agree that a module that mixes
database management and GUI generation is ripe for refactoring.

steve d.

[1] A list comprehension (for instance) translates into a for-loop
anyway; why does it then become a less useful screwdriver, or more
dangerous than a for-loop?