Welcome Guest.   Make a donation to an author on the site September 30, 2014, 01:02:01 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2010! Download 24 custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: The Most Expensive One-byte Mistake: Nice article about programming design goofs  (Read 1759 times)
mouser
First Author
Administrator
*****
Posts: 33,409



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: August 03, 2011, 02:31:39 PM »

Fun article:

Quote
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?



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?
Logged
cranioscopical
Friend of the Site
Supporting Member
**
Posts: 4,170



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: August 03, 2011, 10:54:35 PM »

The Most Expensive One-byte Mistake

Wasn't that Eve's?
Logged

Chris
Deozaan
Charter Member
***
Posts: 6,364



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #2 on: August 04, 2011, 02:39:16 AM »

The Most Expensive One-byte Mistake

Wasn't that Eve's?

That's hilarious!  Grin tongue
Logged

f0dder
Charter Honorary Member
***
Posts: 8,774



[Well, THAT escalated quickly!]

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: August 04, 2011, 02:11:03 PM »

Should the C language represent strings as an address + length tuple or just as the address with a magic character (NUL) marking the end?
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.
Logged

- carpe noctem
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.029s | Server load: 0.15 ]