Came up with serialization algorithm for strings, but only works for words that are < 10 letters long. Halp? : So I had a question about a serialization algorithm I just came up with it, wanted to know if it already exists and if there's a better version out there.

So we know normal algorithms use a delimiter and join words in a list, but then you have to look through the whole word for existence of the delimiter, escape, etc, or make the serialization algorithm not robust. I thought a more intuitive approach would be to use higher level languages like Python where `len()` is `O(1)` and prepend that to each word. So for example this code I attached.

Wouldn't this be faster because instead of going through every letter of every word we instead just go through every word? And then deserialization we don't have to look through every character to find the delimiter, we can just skip directly to the end of each word.

The only problem I see is that double digit sizes would cause problems, but I'm sure there's a way around that I haven't found yet.

It was suggested to me that [protocol buffers](https://developers.google.com/protocol-buffers/) are similar to this idea, but I haven't understood why yet.

    def serialize(list_o_words):
        return ''.join(str(len(word)) + word for word in list_o_words)
    
    def deserialize(serialized_list_o_words):
        index = 0
        deserialized_list = []
        while index < len(serialized_list_o_words):
            word_length = int(serialized_list_o_words[index])
            next_index = index + word_length + 1
            deserialized_list.append(serialized_list_o_words[index+1:next_index])
            index = next_index
        return deserialized_list
    serialized_list = "dick,for,breakfast,pussy,for,lunch,but,please,don't,munch,haba1,daba2".split(",")
    
    print(serialize(serialized_list))
    print(deserialize(serialize(serialized_list)) == serialized_list)