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

Re: succinctness = power



I start to worry if i see the same pattern 3 times or more, especially if 
it is in the same class, which makes it more obvious.  I see repetition, in 
fact, cut and paste, as implementations of Java interfaces.

At 12:24 AM 5/28/2002, Dan Weinreb wrote:
>    Date: Sun, 26 May 2002 13:19:13 -0400
>    From: "Anton van Straaten" <anton@appsolutions.com>
>
>                             Also, in some cases with sufficiently small,
>    one-off programs, high levels of semantic compression may not be directly
>    justifiable.
>
>Indeed, whether to introduce a macro (in the Lisp sense) is a
>judgement call, just as whether to introduce a
>subroutine/function/procedure/method is a judgement call.  Introducing
>any of these things is like an investment; there's a certain up-front
>cost to the person trying to understand the program: I have to
>remember the name of this macro/function/whatever and associate that
>with its meaning.  The investment pays off more and more if (a) the
>concept encapsulated by the macro/function/whatever is something that
>seems to make sense in and of itself, and (b) the
>macro/function/whatever is used many times.  The more (a) and (b)
>are true, the more the existence of the macro/function makes the
>program easier to understand and maintain.
>
>If we actually ran some kind of automatic pattern-recognizer to
>automatically extract macros/functions from our code, I think it might
>sometimes violate (a): it might find patterns that are factorable, but
>the line it draws around this commonality might not actually reflect a
>"meaningful" concept.