by throwawaybbqed · 4y ago · 0 comments
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)The code it replaces also had a strlen in it.
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.
If this what a company with deep roots in C++ world is doing, what are the large majority of "dark matter" software factories doing, specially the sweetshop ones.
Looks just like regular PHP. So what's the point? Or did I miss something?
/s