| commit | 8f0ba417480079999ba552f1087ae592091b9d02 | [log] [tgz] | 
|---|---|---|
| author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Sat Dec 07 02:21:24 2024 +0000 | 
| committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Sat Dec 07 02:21:24 2024 +0000 | 
| tree | 8b1ca4aa0d706c81450e3b749ca58af1bd07b4af | |
| parent | 29d116533ab15c6ff3d6f99b55c6dfeffee42479 [diff] | |
| parent | 27130f606dc64880363d08f32e45a5499ffe218c [diff] | 
Snap for 12763142 from 27130f606dc64880363d08f32e45a5499ffe218c to 25Q1-release Change-Id: I5b01253a6e6b3b6bdb12b5caa52f3c2a47f6b466
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.