Comment

Comment by such_a_casual

    (defun udpate ()
     (let ((pos (find-char-pos)))
       (move-char pos))
     (print (stats))
     (rotate enemies))

    (defun udpate ()
     (set 'pos (find-char-pos))
     (move-char pos)
     (print (stats))
     (rotate enemies))
I now have to keep this 'pos symbol in my head for the rest of the function (in another language, forever in this case), whereas in the first example I can just forget about the variable after the next line. It doesn't exist anymore. It makes code clearer and much easier to refactor since I can immediately see everywhere that the variable is used.

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton