Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

but 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...



A 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.


Maybe 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.


> 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.)


#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. :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: