hatcat / cg30_issues

The public issues repository for the book "Beautiful C++"
4 stars 1 forks source link

Misc SF7 observations #5

Open hatcat opened 3 years ago

hatcat commented 3 years ago

[From Arthur] Page 137 Edit#1 If this were aimed at newbies, I'd caution against using the phrase "namespace Business" when what you mean is "namespace ::World::Buildings::Business". I like to compare namespaces to subdirectories; would you say that both "usr" and "local" are common ancestors of directory "bin" and directory "include", but directory "local" is the LCA? I hope not! That would be super confusing! (I often see students get confused about this, at least with placeholder names like "N1::N2".) Experienced programmers will understand what you actually mean, but then again, they might be just skimming anyway because they already know most of this stuff (or think they do).

I question the use of "Crushing" as the superlative of "Decisive"; I had to go back and look at the inheritance hierarchy to see that these were even different identifiers. :P I'd suggest maybe using something like log levels: Info, Warning, Error?

Your clamp example is a fun war story. But it still falls foul of https://quuxplusone.github.io/blog/2018/06/17/std-size/ Incidentally, your clamp also violated https://quuxplusone.github.io/blog/2021/05/05/its-clamping-time/ but that doesn't really matter because the "don't use common names and especially don't call them via ADL" rule is the more important.