[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Knowing where a function has been used (bis) [Was: Re: Optimising El
From: |
tomas |
Subject: |
Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code] |
Date: |
Mon, 15 Oct 2018 10:25:45 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Sun, Oct 14, 2018 at 09:10:56PM +0200, Emanuel Berg wrote:
> tomas wrote:
>
> > Code "grows", one single (minimum-effort)
> > step by step [...]
> Code grows, but not necessarily by enlonging
> the defuns that are already there [...]
Most of the time it does, though: *this* is the
path of least resistance, for small steps.
> when some new situation arrives, write yet
> another defun to handle it. Then call it from
> the original function. That way the original
> function grows, but only by a single line.
On the long term this tends lead to horrible code,
where the defuns reflect all the history of the
situations, as they arrived, not the problem's
structure as it is *now*. But yes, you see something
of that in actual code -- real life is always a
compromise.
> To do this is much, much simpler than to write
> an insanely long defun, and when insanity
> becomes a problem, try to "refactor" it!
I've seen lots of code evolve. I'm an old guy. My
experience seems to contradict your assessment above.
Keeping code clean, always finding the right abstractions
and enforcing them throughout takes a non-trivial amount
of effort. I tend to think that "it's worth it", at least
in terms of self-esteem and developer satisfaction, and
I like to think that, in the long term, it amortises itself
in terms of effort, but for the last one I can't say whether
(or when) it is wishful thinking or not.
Cheers
-- tomás
signature.asc
Description: Digital signature
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], (continued)
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/09
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Barry Margolin, 2018/10/10
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/10
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Barry Margolin, 2018/10/11
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/11
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Barry Margolin, 2018/10/12
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Eric Abrahamsen, 2018/10/12
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/13
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], tomas, 2018/10/14
- Message not available
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/14
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code],
tomas <=
- Message not available
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/15
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Van L, 2018/10/15
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Garreau, Alexandre, 2018/10/16
- Message not available
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/17
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Óscar Fuentes, 2018/10/10
- Message not available
- Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code], Emanuel Berg, 2018/10/08
- Naming, and Gnus functions length [Was: Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code]], Garreau, Alexandre, 2018/10/08
- Message not available
- Re: Naming, and Gnus functions length [Was: Re: Knowing where a function has been used (bis) [Was: Re: Optimising Elisp code]], Emanuel Berg, 2018/10/08
- Re: Naming, and Gnus functions length [, Garreau, Alexandre, 2018/10/08
- Message not available
- Re: Naming, and Gnus functions length [, Emanuel Berg, 2018/10/08