

Poul-Henning Kamp: The Most Expensive One-byte Mistake - cpeterso
http://queue.acm.org/detail.cfm?id=2010365

======
zurn
Very good article.

There is a huge cultural blindfold that Unix/C have formed indirectly formed
on everybody's thinking about computers. Most of us have never used computers
outside the Unix sphere of influence.

The point about hardware (in this case instruction set) adapting to Unix/C
strings is also a recurring pattern, and makes it hader to climb out of the
pit of local optimum /path dependence.

Fun thought experiment to think how things might have turned out if ideas from
Burroughs mainframes, Transputer, Lisp machines or Intel i432 type of things
had taken off.

But Unix was easy to port because of simplicity, kinda-open-source for
universities, etc. even though those properties soon disappeared after it
became popular. And we know the rest.

~~~
epo
Actually most have never knowingly used computers outside the Windows sphere
of influence but we shall let that pass. Unix was a massive breath of fresh
air at the time, it became popular and widespread because it was so much
better (and more accessible/cheaper) than commercial operating systems of the
time.

The cultural bindfold you refer to is because there has been no comparable
revolution in operating systems design since Unix, people tinker
(comparatively) at the edges because Unix got so much right. NUL terminated
strings is a minor aspect of library design. Yes with hindsight if things had
been done differently then things might now be different, but like the QWERTY
keyboard once decisions get out in the world they become too difficult to
reverse.

~~~
zokier
Windows, especially the NT line, has certainly been inside "the UNIX sphere of
influence".

~~~
jpitz
Well, more like VMS.

------
pja
I knew without looking that this was going to be about NUL-terminated strings.

Now, if it had been about NULL pointers, then Tony Hoare has called them his
billion $ mistake.

Is there an anti-pattern here?

~~~
pja
Thinking about it, NULL in SQL databases has been a big source of issues too.

NULL. Just say no :)

------
josteink
_A programmer who worked with the compilers on the Convex C3800 series
supercomputers related his experience as "having to program as if the compiler
was my ex-wife's lawyer."_

Reading this made me realize very few people fully appreciate how good
compilers have become these days.

I'll add some love to the MS C# compiler, despite its shortcomings, just
because whoever worked on it absolutely deserves some love.

------
franciscoapinto
Interesting discussion on the rationale behind null-terminated strings:
[http://stackoverflow.com/questions/4418708/whats-the-
rationa...](http://stackoverflow.com/questions/4418708/whats-the-rationale-
for-null-terminated-strings)

------
EvilTerran
_"the costs of the Ken, Dennis, and Brian decision will keep accumulating,
like the dust that over the centuries has almost buried the monuments of
ancient Rome"_

... look upon my gets(), ye mighty, and despair?

