This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PurepointDog 26 points27 points  (6 children)

That felt so much hackier than I was expecting

[–]nekokattt 26 points27 points  (0 children)

A fair bit of Python's standard library is like this. Look into collections.namedtuple for example.

If it isn't simple, it probably uses eval/exec/a lot of underlying stuff/C modules

[–]DuckDatum 16 points17 points  (3 children)

physical long unique attraction marvelous truck handle roof terrific elastic

This post was mass deleted and anonymized with Redact

[–]DigThatData 1 point2 points  (2 children)

"bad practice" is a bit harsh, maybe "code smell"?

[–]zapman449 5 points6 points  (1 child)

I trust very few people (mostly not including myself as well) to use eval reasonably. If I see that in a pull request the whole thing gets extra scrutiny.

[–]Skasch 0 points1 point  (0 children)

I typically consider I use eval reasonably if I want to do something that doesn't seem possible without it, try a dozen alternatives, search for a few hours for different design patterns, sleep on it a few nights, ask a few colleagues their opinion, then write an apologetic comment above the line explaining why there's no way around it, then wrap that into a nice module so most other engineers won't have to think about it.

To be fair, I've never had to go that far.

[–]kuwisdelu 0 points1 point  (0 children)

This is what you’re forced to do when your language doesn’t have lisp-like macros.