tag | 5fcb2119d01964e9b47a584c7eec2959bc50f600 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Thu May 19 16:26:53 2022 -0700 |
object | 16abebe31e8ccdcde87b964ee03dd6d5d6204689 |
Platform Tools Release 33.0.1 (8253317)
commit | 16abebe31e8ccdcde87b964ee03dd6d5d6204689 | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 04 04:29:21 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Fri Mar 04 04:29:21 2022 +0000 |
tree | a0845524882d98eb62ca9459a440e46e3b2c035d | |
parent | 833338979a0c005330ff6dfcbd1e812516adad7b [diff] | |
parent | dbe499e5997f5d02ebbc3fd3884c349796175f61 [diff] |
Snap for 8253222 from dbe499e5997f5d02ebbc3fd3884c349796175f61 to sdk-release Change-Id: Ie37e24f1fdc416ff6bc978446cf3e4a756f780d2
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.