by pjmlp · 4y ago · 0 comments
Enjoy a sample of AOSP source code, https://android.googlesource.com/platform/art/+/refs/heads/m...
In fact, if we focus on traditional enterprise shops they are stuck in what I call the C+ mindset.
Those of us that bother to live in HN, Reddit, attend CppCon, C++Now, C++ on Sea, ACCU in whatever form, are 3lit3. A tiny minority that actually cares about quality.
That is the point.
What am I looking for? Is it just the use of smart pointers?
Personally I wouldn't like to slog through this on a moment's notice but it seems named well and there are a lot of comments, and appears to have been through clang-tidy.
You posted this for a reason .. would be good to get your thoughts.
edit: adding one more point. I went to a fairly high-ranked university(top-20). We would get graded based on how clear our code was, comments (both for functions and inline comments). This code would get a zero on those metrics.
https://android.googlesource.com/platform/art/+/refs/heads/m...
like, just this, basically C:
if (strncmp(argv[arg_idx], "-XXlib:", strlen("-XXlib:")) == 0) {
...
is just so complicated and error-prone over if(std::string_view{argv[arg_idx]}.starts_with("-XXlib:"))
...
(which I guess is the intent)So, the example is of bad old code, at a place that enforces bad coding practice. The intent appears to be to suggest this is typical practice, which is not supported.
Looks just like regular PHP. So what's the point? Or did I miss something?
/s