tag | 84ffe14a29de7decf3c0ec773881a7cf6f083e1e | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Mon Apr 15 11:23:09 2024 -0700 |
object | 838c0aa1615d8b025c0fedd6a0af9b03e06aa0fc |
Android 14.0.0 Release 33 (AP1A.240405.002.B1)
commit | 838c0aa1615d8b025c0fedd6a0af9b03e06aa0fc | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Nov 15 00:22:42 2023 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Nov 15 00:22:42 2023 +0000 |
tree | edbdb26713d2e1be9283d6cc2c1e052c32832888 | |
parent | 6d47eb06f38cf789370d2d7240df04a522668c5d [diff] | |
parent | 09fe472317b1656315058815939d52f47c75885d [diff] |
Snap for 11097608 from 09fe472317b1656315058815939d52f47c75885d to 24Q1-release Change-Id: Id4919ac4a6c9758d14b95c277307aa45414dc476
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.