help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: modularity, code for yourself and possibly others


From: Tadeus Prastowo
Subject: Re: modularity, code for yourself and possibly others
Date: Tue, 2 Apr 2019 11:42:59 +0200

On Tue, Apr 2, 2019 at 12:48 AM Emanuel Berg <moasenwood@zoho.eu> wrote:
> Moving one function from edit.el to some other
> file would require the user to `require' that
> file instead, and that file would `require' yet
> another file(s), and so on. How would that be
> any different?
>
> In the extreme case, for someone else to use
> a single of my .el files, s/he would have to
> use my entire Elisp system!

Rather than going off tangent now by talking about the extreme case,
what about if we confine our discussion _for now_ to your specific
case of dealing with your pet function `delete-blank-lines'?

If you agree, then let's say we put that pet function to its own file
`whitespace-cleaners.el'.  As of now, that file will require no other
file.  So, its user will need to require only that file if that user
needs no other function of yours.  Problem solved here.

Now, let's enlarge the case a bit.  Suppose now the user also wants to
use one other function of yours in file `edit.el'.  If you had
engineered that function _and_ that file properly, then the user would
have no need to have your entire Elisp system.  Problem solved.

Jumping now to the general situation, a tradeoff exists between
reinventing the wheel and having a long chain of dependencies.  For
having zero dependency, reinvent all the wheels.  To minimize wheel
reinventions, add further dependencies.  As the engineer of your own
Elisp system, you should think about the right design; surely
different potential users of your Elisp system have their own
requirements regarding this tradeoff.

--
Best regards,
Tadeus



reply via email to

[Prev in Thread] Current Thread [Next in Thread]