
On Fri, 11 Feb 2011 13:24:06 -0500 Vlad Lazarenko <vlad@lazarenko.me> wrote:
On Fri, Feb 11, 2011 at 12:44 PM, Chad Nelson <chad.thecomfychair@gmail.com>wrote:
For example, you have this "almost" random-access feature that, IIUC, for UTF-8 will give you O(1) random access if you have only ASCII characters and for UTF-16 will give you O(1) random access if you have only BMP characters. That's just horrible! [...]
If you put it that way, you're right. I assumed that the developer using the library would read the documentation and know that the iterators weren't always true random-access, but that assumption doesn't stand up to conscious examination.
Unfortunately, users tend not to read documentation. From my experience, many just using copy-paste from examples and modify the result to fit their needs.
Mine too -- that's what I meant by conscious examination, when I thought about it I realized that almost no one reads documentation except as a last resort.
IMHO the default behavior should be the fastest from the most safest. But having an example of "tricky" usage to improve performance with the explanation of pros and cons will help some users to copy-paste from the right place and read documentation before they do so.
Hm, nice idea. Thanks. -- Chad Nelson Oak Circle Software, Inc. * * *