RippeR37/libbase

Contrasting coding styles with chromium/base

rohanverma94 opened this issue · 2 comments

I've observed one thing, the chromium style guide has censored a lot of modern C++ features. This repository chose to go all together in another direction. For instance shared_ptr is banned in the chromium's codebase.

https://chromium.googlesource.com/chromium/src/+/HEAD/styleguide/c++/c++-features.md#Shared-Pointers-banned

Please clarify if any style guide exists for this project. Looking forward to contribute to this project

Please refer to Introduction documentation page.

TL;DR - this project adheres to the Google Style Guide but does make exceptions for things that are now implemented in the STL and will use them instead of the custom solutions (unless some functionality cannot be achieved without writing a custom counterpart). For example: for a long time Chromium's code didn't have C++17 so it had to use its own custom base::Optional type. Then it switched to absl::Optional. This library aims to have as few external dependencies as possible and there is an implementation of optional in STL now, so we simply use it. Similarly with std::shared_ptr vs scoped_refptr.

NOTE: scoped_refptr have a few more usages in //base, but I decided to not go for them here, so for now there is no need to port it/reimplement it here.

Thanks for the clarification. It is true that chromium's //base has quite a tech debt owing to modern C++ and hence they continued with the in-house implementation.