61
you are viewing a single comment's thread
view the rest of the comments
[-] palordrolap@fedia.io 5 points 2 days ago

In most languages evals are, in a way, like gotos. You should aim to write your code with none at all, but they're nice to have in a pinch if the project takes a turn and a rewrite might take time you don't have. Just don't put user-supplied strings through one and you'll be fine. Probably.

Also, in at least one language I can think of, there's a variant of eval that works a lot like try in other languages. As such, I don't think those should be considered the same thing.

[-] Badabinski@kbin.earth 1 points 2 days ago

There are generally different degrees of eval as well. ast.literal_eval in Python is much more forgivable, and is the only reasonable way to handle data generated by chucklefucks who think simply stringifying a dict and writing it to a file is a reasonable serialization strategy.

[-] luciferofastora@feddit.org 1 points 1 day ago

chucklefucks who think simply stringifying a dict and writing it to a file is a reasonable serialization strategy.

"Pickle, motherfucker, do you speak it?"

this post was submitted on 26 Nov 2026
61 points (100.0% liked)

Programmer Humor

34316 readers
1496 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 3 years ago
MODERATORS