-- Leo's gemini proxy

-- Connecting to idiomdrottning.org:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; lang=en

Whitespace philosophy (for Lisp stuff)


Can people who put in a ton of whitespace in the middle of lines so that (on monospace) bindings or table values match up vertically please lay that off? Thank you.


It looks messed up on proportional fonts and on screenreader.

It’s difficult to extend; say you need to add a new line and it makes some of the “columns” now too narrow. Your diff now has to touch every line.

It makes it fiddly to add code in that area and to use Paredit properly.

You can’t string search for key/value pairs or name/binding pairs without a whitespace regex.


I don’t want my Lisp to be ASCII art. This isn’t Befunge.


(This isn’t refering to whitespace at the beginning of lines, a.k.a. indentation. That’s fine.)


Befunge on Wikipedia


Update: an example


Let’s say we have this code:


(defcustom straight-hosts '((github    "github.com"    ".git")
                            (gitlab    "gitlab.com"    ".git")
                            (bitbucket "bitbucket.com" ".git")))

First of all, it looks dumb on proportional fonts (where a space isn’t the width of a character) and on screenreaders (where you only can read one line at a time).


Then, let’s say we wanna change this by adding a longer line, like, say, a frobnicate forge.


(defcustom straight-hosts '((github    "github.com"    ".git")
                            (gitlab    "gitlab.com"    ".git")
                            (bitbucket "bitbucket.com" ".git")
                            (frobnicate "frobnicate.example" ".git")))

Now the columns are wack, which, again, you’d need a visual display with monospace characters to see.


This is fiddly AF to try to align, and if you do manage to do it:


(defcustom straight-hosts '((github     "github.com"         ".git")
                            (gitlab     "gitlab.com"         ".git")
                            (bitbucket  "bitbucket.com"      ".git")
                            (frobnicate "frobnicate.example" ".git")))

your diff now has to touch every single line in the sexp.


I really like using Paredit to write code because of how it lets me think of the code in terms of nodes and edges as opposed to how it’s visually represented. I navigate the code like a tree, going in and out of sexps.


But let’s say we do manage to write and commit this code. Then, when we wanna search for a line of code that has, say, frobnicate followed by “frobnicate”, we can’t grep for it unless we use a variable whitespace regex.


Instead, I want the code to look like this:


(defcustom straight-hosts '((github "github.com" ".git")
                            (gitlab "gitlab.com" ".git")
                            (bitbucket "bitbucket.com" ".git")
                            (frobnicate "frobnicate.example" ".git")))

Each inner list is represented as meaningfully its own thing.

-- Response ended

-- Page fetched on Sat Apr 27 02:30:35 2024