3 ms·
> not to explain why he choose "" as tombstone Because his "neutral pseudocode" (go) doesn't allow setting the string entries in an array to nil. You have to h
by viraptor 8y ago
> not to explain why he choose "" as tombstone
Because his "neutral pseudocode" (go) doesn't allow setting the string entries in an array to nil. You have to have some value, so commonly you'd use "".
- LordHeini 8y agoBut one can not add an empty string to the array which is an obvious bug. There are slices in go which should be used in this case.
- viraptor 8y agoIt's a toy example in a semi-funny (or trying) post. Did you really expect handling of all the edge cases?
- rurban 8y agoNo because it's Ted Unangst writing about "Removing Array Duplicates", the guy who added string arguments being comma-splitted at run-time instead of using safe and fast bitmasks to new OpenBSD API's. So we know already that he has no idea what he's doing, and shouldn't be let to any important API in serious projects. But he writes like he has an idea what he's doing, so I had to explain the common cases for this problem. Using tombstones is a special case and you need to be lucky to have such a special illegal value available. Most cases don't allow it, esp. in strongly typed languages.