5 ms·
The string type isn't broken. If anything these "X is broken" posts are broken. Taking one special case, finding problems with that case and deducing that the w
by this_user 13y ago
The string type isn't broken. If anything these "X is broken" posts are broken. Taking one special case, finding problems with that case and deducing that the whole concept must therefore be discarded is just silly. Strings work fine for the vast majority of use cases. No technology is free of flaws and engineering decisions are almost always based on weighting the pros and cons and choosing a solution that on balance works best. Strings are a useful feature and Unicode is a notoriously hard problem. Proposing to go back to arrays of characters makes things worse for most people in most cases and therefore is not a practical solution.
- jckt 13y agoExactly. Engineering =/= Maths.
- mercurial 13y agoIn my experience, the world is full of software which "work fine for the majority of use cases" until the point where you take the wrong code path and things go south.
- jodrellblank 13y agoMuch like human brains, and business processes.
- lnanek2 13y agoThat's OK, sounds like he is writing a new language, so screwing up on the strings implementation is par for the course. Languages and databases don't typically get correct string handling for many years later after they are born, if ever. Supporting all the unicode and other character set insanity takes years of work. Asking someone writing a language to get strings right is like asking a five year old to obtain a drivers license.
- gutnor 13y agoVast majority of use cases in the English-speaking world. In other countries like China, Japan, India, ... those edge cases are common enough to represent a significant portion of use cases and make X truly broken. The article is maybe a bit provocative, but you know what, that's exactly what is needed to raise awareness of mainly US-centric developers who would completely ignore the technical issues until they face a clone in China whose only innovative feature is not breaking on Chinese text.
- regularfry 13y agoConflating the responsibilities of "character list" with "byte array" is always going to go badly.
- hrktb 13y agoThe point is not to reduce the number of options (everyone going back to arrays of characters) but to put the spotlight on some problems where going a level lower could help a lot. > *Strings work fine for the vast majority of use cases In the CKJ space (a third of the population ?) strings are "broken" in the vast majority of use cases (really, things like what format you should accept for a telephone number). It get exponentially dirty as you try more complex manipulations, and I think these are interesting problems. It helps discussing them from time to time.