this post was submitted on 22 Nov 2025
651 points (98.7% liked)

Programmer Humor

27690 readers
451 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 

cross-posted from: https://lemmy.ml/post/39334581

you are viewing a single comment's thread
view the rest of the comments
[–] SlurpingPus@lemmy.world 2 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

I mean, the go-to approach in Lisp, for example, is to have null as the default value (which doubles for false in there). And check for that in the function.

[–] joyjoy@lemmy.zip 2 points 2 weeks ago (1 children)

That sounds awfully similar to JavaScript, which uses undefined as default values.

[–] SlurpingPus@lemmy.world 1 points 2 weeks ago (1 children)

In Lisp, at least the Emacs Lisp with which I have experience, it's customary to put in nil (Lisp's null) for any omitted arguments in the middle that you can't be arsed to specify — aside from just leaving off arguments at the end. In JS, typing in undefined in every such case would probably be an annoyance, so I'm guessing coders need to check for both undefined and null in these circumstances.

Overall, it's remarkable how Lisp teaches one to be much more relaxed about programming practices than is typical for mainstream languages. Design patterns? Data structures? Shit, just pass in a list or an assoc array, and maybe a function here and there. Also everything is an expression, enjoy your ternary (if) at any point anywhere.

[–] eager_eagle@lemmy.world 1 points 1 week ago

Design patterns? Data structures? Shit, just pass in a list or an assoc array, and maybe a function here and there

After trying to be relaxed about data structures in python, I can say that, IMO, this is more harmful than beneficial. Good types and structures lead to good code designs.