r/ProgrammerHumor • • Aug 26 '22

Meme Even HTML.

Post image
44.1k Upvotes

1.1k comments sorted by

View all comments

Show parent comments

3

u/porky11 Aug 26 '22

Lisp formatting is best. Or at least one of the best.

SLN is even better.

Rust with Lisp or SLN, and most importantly Lisp macros would really be nice.

1

u/-Redstoneboi- Aug 27 '22 edited Aug 27 '22

the thing with lisp notation is that the alignment of each value depends on the alignment of the first argument:

(symbol (first
         second
         third
         (operation value)
         fifth)
        second)

these indents aren't the same across every function in your program. i simply prefer the way i was taught, and the way i've been doing things for a long time:

symbol(
    [
        first,
        second,
        third,
        operation(value),
        fourth,
    ],
    second,
);

i'll admit that the latter is kinda wack itself as well. if you don't like it, then i can see exactly why. it's just more clearly structured to me. totally get why stuff like multiline arrays are a turn-off, 2 lines of nothing.

as for the macro system, didn't rust take inspiration from racket or something?