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

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

Re: Too fine design granularity leads to numerous macro/function/command


From: Arthur Miller
Subject: Re: Too fine design granularity leads to numerous macro/function/command existed in Emacs.
Date: Fri, 13 Aug 2021 15:48:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Emanuel Berg via Users list for the GNU Emacs text editor
<help-gnu-emacs@gnu.org> writes:

> Arthur Miller wrote:
>
>> Not to mention, that writing lisp is almost like writing
>> pseudo-algorithm. If you reflect over the names chosen in
>> that function, you can almost see that it was codded on the
>> go, as I was thinking of it. Compare that to pipes and names
>> like tr and cut and what not in your original shell
>> solution. So it is a kind of simplicity, in my eyes, to use
>> just one language, and I guess also a bit of personal
>> preferance of course.
>
> As for development time, if that's the right word, it must be
> much, much faster using the shell, which is mostly about

Why does it "must be" much much faster to code in shell than
elisp? Who says that? :)

> combining well known tools often with options and pattern that
> return over and over - it is very, very fast.
>
> Compare - this takes as long to do, as it takes to type it:
>
> #! /bin/zsh
> longest-line () {
>     local f=$1
>     awk '{ print length($0) " " $0; }' $f | sort -n | tail -1
> }
>
> with this - now, I had a function that worked along similar
> lines (ha) so for that reason, it wasn't that slow to write
> compared to the shell, without that, I don't know, depends on
> the current state/shape :)

I really like shell too, and unix philosophy and have been coded
shell for like 20 years, compared to elisp which I really started to
learn relatively recently, say one year ago, but I find lisp much faster
to code than shell. That what you coded there requires knowledge of
zshell, awk, sort and tail. If you call it from Emacs you pay four
process penalty compared to none if you code it elisp. Not to mention
the portability, elisp will work without modification in Windows or Mac
too, your shell solution might or might not work as expected. Also if
you need to call it in other lisp functions you will have to wrap your
shell script in shell-command or start/call-process, so I personally
really don't see any point in doing it in shell instead of elisp,
because I don't see benefit. But you should of course, choose whatever
suits *your* heart and mind :). 



reply via email to

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