Skip to content

Commit

Permalink
Butter C++: clarify goals/intent in the comment
Browse files Browse the repository at this point in the history
Summary:
Just clarifying the purpose of this library.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33245053

fbshipit-source-id: b4325415774ca33b34b5ba53d222a19f88e2175f
  • Loading branch information
fkgozali authored and facebook-github-bot committed Dec 21, 2021
1 parent 6a93c07 commit f142bfe
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions ReactCommon/butter/butter.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,34 @@ namespace facebook {
namespace butter {

/*
* `Butter` is a trivial collection of basic tools borrowed from other low-level
* `Butter` is a minimal collection of basic tools borrowed from other low-level
* general purpose libraries (like Folly, Abseil or Boost). The main goals of
* Butter:
* - Make the codebase more portable;
* - Make the dependency list explicit (by decoupling it as a dependency list of
* Butter);
* - Make relying on modern C++ patterns and tools in code simple and easy.
* - Make executing experiments with different dependencies easier.
* - Limit reliance on third-party libraries eventually.
*
* Target C++ Version
* ------------------
* Currently, Butter targets C++17.
*
* The Scope
* ---------
* What should be part of Butter and what should not? Should I add some piece of
* functionality in the Butter? Here is a quick checklist.
*
* As of now, Butter is relatively permissive per the guidance below:
*
* If one of the following is true, yes, go for it:
* - If some feature is already in some future C++ standard (possibly in draft
* stage) and it's already implemented in some 3rd party library.
* - If some standardized feature of C++ is implemented in the standard not in
* the most efficient way (because the standard enforces some tricky constraints
* (like always-valid iterators) which nobody uses and should use), but you have
* a library that does it right providing exact same interface.
* the most efficient way (because the standard enforces some tricky
* constraints, like always-valid iterators, which nobody uses and should use),
* but you have a library that does it right providing exact same interface.
*
* If one of the following is true, please do *NOT* do it (at least as part of
* the library):
Expand All @@ -41,6 +50,11 @@ namespace butter {
* faster than the standard one, so You want to use that in the code base. That
* container does not have compatible API though (because it's a clear trade-off
* with efficiency, of course).
*
* Note that eventually Butter will restrict the API collection to reduce
* reliance on non-standard C++ builtin libraries. That way, the API footprint
* stays small and is limited to just the essential APIs. This restriction is
* currently a work in progress.
*/

/*
Expand Down

0 comments on commit f142bfe

Please sign in to comment.