News for hackers. Stuff that matters.
Re:Evolution of Emacs Lisp [pdf] by stiff on Sunday October 21, 2018 @03:22PM (#18269648)
To read a file into a string you actually do this:

  (with-temp-buffer
    (insert-file-contents filePath)
    (buffer-string))
but if you work with file contents as strings in Emacs Lisp, you are going to have a bad time, because performance of this is terrible enough for it to easily turn into a problem. So instead you insert-file-contents into the temporary buffer and then do a ton of low-level, error-prone imperative processing on the buffer contents itself using things like goto-char, search-forward, using markers etc. Most of the major emacs packages are littered with code like this, here is one random example:

https://github.com/magit/magit/blob/master/lisp/magit-git.el...

It reads like fortran77 to me.

Re:Evolution of Emacs Lisp [pdf] by tarsius on Sunday October 21, 2018 @05:00PM (#18270230)
That's indeed completely unreadable and I wrote it. But it also isn't typical. In this particular case I replaced an earlier "functional" implementation with this abomination to fix a performance bottleneck. Though I think I might have gone overboard -- unfortunately the commit message isn't very good either and doesn't explain why it was necessary to switch to this style of doing things in addition to what the message actually talks about.

    (--map (list (substring it 3)
                 (aref it 0)
                 (aref it 1))
           (magit-git-items "status" "-z" "--porcelain" "-u" "--ignored"))))
Generally speaking you don't have write code like what you linked too unless you have a very good reason to do so (I doubt that I had in this case, but who knows).
Re:Evolution of Emacs Lisp [pdf] by heinrichhartman on Sunday October 21, 2018 @03:45PM (#18269762)
Exactly my experience as well. Those are horrible patterns, that can only be excused by history.
Re:Evolution of Emacs Lisp [pdf] by justinhj on Sunday October 21, 2018 @07:35PM (#18271011)
I guess the problem is one of expectations. It is primarily a DSL for working with emacs, not a general purpose programming language like Common Lisp.