3 ms·
Three Different Cuts
- PaulHoule 3y agoIt’s a function I like because it encourages string handling by linear scan. Today UTF-8 is the standard character encoding out of memory but we are still converting it to a fixed-length encoding, often with the optimization of encoding ascii-only string as ascii as seen in Java and Python these days. If your encoding is variable size that is no problem for linear scans and you can recode a regex over unicode into a regex over utf-8 bytes or implement some not quite linear algorithm like Boyer-Moore over bytes, etc. If you quit encouraging people to index into particular points of a string it is pretty easy. I mean, who really uses fixed-length string structures anymore?
- nubinetwork 3y ago[flagged]