4 ms·
edit: I don't really want to get into a CS/data structures argument with you, 'cuz I like having a chance at winning when I argue stuff. It's not wrong. I thin
by latch 15y ago
edit:
I don't really want to get into a CS/data structures argument with you, 'cuz I like having a chance at winning when I argue stuff.
It's not wrong. I think when you say String people think of:
String name = "Leto Atreides";
In Redis (and I guess as a Computer Science term) it means:
byte[] anything = ....
Although, the Wiki page does say:
generally understood as a data type...using some character encoding
With the redis implementation not having any character encoding.
It isn't a big deal, but I think you'd find that it can be a little confusing to us some.
- antirez 15y agobut strings in most languages such as C, Python or Ruby are exactly random access sequences of bytes. And btw 'binary' is a form of encoding in a string. So Redis strings are strings ;) in a full sense. I think that if calling what are strings, "strings", can generate confusion, go figure how much confusion can be created by calling them with another term...
- davedx 15y agoA byte array is not necessarily a string. Is an image a string? Is a video on YouTube a giant string? They happen to be equivalent at a data storage level, but they're not semantically equivalent. I think the article explains the difference quite well to be honest.
- LeafStorm 15y agoMaybe a better term would be "scalar" like in vector calculus or Perl, to emphasize that the larger data structures consist of scalars arranged in some form.
- technomancy 15y ago> but strings in most languages such as C, Python or Ruby are exactly random access sequences of bytes. This is true, but at least with Ruby it's widely regarded as an embarrassing design mistake. (Not that it's a mistake in Redis; a database has different goals from a language.)
- mkramlich 15y ago#1 you rock for Redis. hail/praise/kudos (seriously!) #2 I and a lot of other programmers tend to think of a string (for me, going back decades) as "a byte sequence which just happens to represent text, in some encoding". It's not merely a byte array. A byte array could be say an encoded image (PNG, GIF, etc.) or some other serialized object. That said, this distinction/confusion in terminology is not important. It pales in comparison to how awesome Redis is. :)