commit | 697b22315db440ae11c89f6d60a17d3bfd780f45 | [log] [tgz] |
---|---|---|
author | ThiƩbaud Weksteen <tweek@google.com> | Wed Sep 01 05:05:21 2021 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Wed Sep 01 05:05:21 2021 +0000 |
tree | 0b940d660e3a1a728317bd64a5ef73b548c3165a | |
parent | 37f7d45885c37be0d89d6fdf9ac00d68a3865ebf [diff] | |
parent | 436d602298d2372d40f8b66aa5145a4a5a9850ad [diff] |
Fix documentation for expected am: ae08ecfe24 am: 46b3063831 am: 823738e108 am: 436d602298 Original change: https://android-review.googlesource.com/c/platform/system/libbase/+/1814776 Change-Id: Ia5f6d8d3e6e00eaed1c24c7d92378ba018f96950
This library is a collection of convenience functions to make common tasks easier and less error-prone.
In this context, "error-prone" covers both "hard to do correctly" and "hard to do with good performance", but as a general purpose library, libbase's primary focus is on making it easier to do things easily and correctly when a compromise has to be made between "simplest API" on the one hand and "fastest implementation" on the other. Though obviously the ideal is to have both.
The intention is to cover the 80% use cases, not be all things to all users.
If you have a routine that's really useful in your project, congratulations. But that doesn't mean it should be here rather than just in your project.
The question for libbase is "should everyone be doing this?"/"does this make everyone's code cleaner/safer?". Historically we've considered the bar for inclusion to be "are there at least three unrelated projects that would be cleaned up by doing so".
If your routine is actually something from a future C++ standard (that isn't yet in libc++), or it's widely used in another library, that helps show that there's precedent. Being able to say "so-and-so has used this API for n years" is a good way to reduce concerns about API choices.
Unlike most Android code, code in libbase has to build for Mac and Windows too.
Code here is also expected to have good test coverage.
By its nature, it's difficult to change libbase API. It's often best to start using your routine just in your project, and let it "graduate" after you're certain that the API is solid.