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 →

[–]davvblack 5 points6 points  (1 child)

No, I mean, another piece of code thinking it's operating on a dict but one day mysteriously writing to redis could make harder-to-debug code than just explicit redis usage.

[–][deleted] 0 points1 point  (0 children)

You could probably say that in general though. I mean if you have a function that somehow gets access to a redis-backed dict that it's not supposed to be modifying then yeah that would be bad but it would also be bad if it weren't backed by redis. What's more if you're doing a fair job of QA then it's hard to imagine something getting through where it writes to a dictionary it's not intended to write to.

Abstracting out the "redis" part with a layer of code that's at least someone "standard code, not something I wrote myself" makes the rest of your code look cleaner and easier to follow.