61
Patron saint of doing it wrong
(lemmy.nz)
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.
In most languages
evals are, in a way, likegotos. 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
evalthat works a lot liketryin other languages. As such, I don't think those should be considered the same thing.There are generally different degrees of eval as well.
ast.literal_evalin 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."Pickle, motherfucker, do you speak it?"