MHN
Add a comment on Hacker News →
1 of 170 comments
  1. Efficiency looks past current deficiency.

    We have the empty string: "\0"

    We have the null string: NULL

    There is no concept of an INVALID string, as float has NAN.

    This would be the result of trying to copy a string to a buffer that is too small.

    Or sprintf() into a small buffer.

    Or a raw string parsed as UTF-8 and is invalid.

    Correctness over efficiency.