ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

The Most Expensive One-byte Mistake: Nice article about programming design goofs

(1/1)

mouser:
Fun article:

The best candidate I have been able to come up with is the C/Unix/Posix use of NUL-terminated text strings. The choice was really simple: Should the C language represent strings as an address + length tuple or just as the address with a magic character (NUL) marking the end?

--- End quote ---


http://queue.acm.org/detail.cfm?id=2010365





from The best candidate I have been able to come up with is the C/Unix/Posix use of NUL-terminated text strings. The choice was really simple: Should the C language represent strings as an address + length tuple or just as the address with a magic character (NUL) marking the end?

cranioscopical:
The Most Expensive One-byte Mistake
-mouser (August 03, 2011, 02:31 PM)
--- End quote ---

Wasn't that Eve's?

Deozaan:
The Most Expensive One-byte Mistake
-mouser (August 03, 2011, 02:31 PM)
--- End quote ---

Wasn't that Eve's?
-cranioscopical (August 03, 2011, 10:54 PM)
--- End quote ---

That's hilarious!  ;D :P

f0dder:
Should the C language represent strings as an address + length tuple or just as the address with a magic character (NUL) marking the end?-mouser (August 03, 2011, 02:31 PM)
--- End quote ---
If it had done anything else, the situation would probably be worse today.

NUL-terminated strings aren't optimal, but they were the logical choice back then, and are better than some of the alternatives. The BIG mistake is how a lot of the libc (and especially the string functions!) were designed.

Navigation

[0] Message Index

Go to full version