Why Is Escaping Data Considered So Magical?

Steven D'Aprano steve-REMOVE-THIS at cybersource.com.au
Mon Jun 28 22:07:50 EDT 2010


On Mon, 28 Jun 2010 20:55:53 -0400, Roy Smith wrote:

> The nice thing about null-terminated strings is how portable they have
> been over various word lengths.  Life would have been truly inconvenient
> if K&R had picked, say, a 16-bit length field, and then we needed to
> bump that up to 32 bits in the 80's, and again to 64 bits in the 90's.

Or a Pascal 8 bit length field.

However the cost of null-terminated strings is that they can't store 
binary data, and worse, they're slow. In fact, according to some, null-
terminated strings are the *worst* way to implement a string type.

http://www.joelonsoftware.com/articles/fog0000000319.html



-- 
Steven



More information about the Python-list mailing list