TLDR: Please reconsider the policy of deferred and comingled modernization of Chromium source code.
---
Greg (grt) recommended that I contribute to this 6 year old topic (apparently awakening it).
Often I find doing code reviews in Edge that there is friction between the desired code result and the available paths to get there. The relative abundance of NULL in Chromium source is a problem.
An example of this happened yesterday when viewing a proposed change in Edge that introduced a new member pointer. The initialization was using NULL, which aligned with the rest of the file.
Should I recommend using nullptr for the one introduced variable? That doesn't seem sane. Based on a subsequent discussion, I pushed the following CL:
Initial feedback:
"I think we generally lean towards making these sort of changes incrementally as code is modified for other reasons rather than en-masse like this."
My gut reaction (which I've had in the past, for example, when reviewing the coding guidelines) was that it's a bit of a cop-out to have guidelines that only apply to new code. It means you'll have a hybrid codebase forever by trying to making an arbitrary divide between "new code" and "old code" that is an absurd distinction in a large, active codebase. It also motivates behavior like making an arbitrary change to a file (or renaming it) just so you'll have an excuse to change the "old code" because the presubmit tools now call it "new". If the new rules have significant value and reasoning, shouldn't they be applied consistently? Is older code considered less valuable (such that you intentionally let it rot in quality and maintainability)? Anyway, end of gut reaction.
Regarding "change incrementally as code is modified for other reasons":
1. Functional changes comingled with formatting and "getting up to conventions" is generally bad practice, IMO. Modernization changes should be committed separately from new behavior/features.
2. Comingling means the important part of the change (especially for simple changes) gets buried in a sea of additions and removals when reviewed and in GIT history.
3. Comingling distracts the code review process, and leads to reviewer fatigue which damages the efficiency and completeness of the important part of the review.
4. Comingling presents a problem if the associated functional changes needs to be reverted.
5. Comingling introduces artificial conflicts between unrelated functional changes that happen to touch at least one common source file.
6. The "mixed currency" of a subdirectory, and even worse a source file, is a nightmare for those of us working downstream. When a developer adds a new member variable they have to carefully remember to use different standards for the new code vs. the old code. Changing the old code (comingled or not) introduces merge conflicts that are problematic in the short, medium, and long term. This makes it all the more important to modernize upstream, and the best way to do that is separately so that downstream merges don't "miss" something functional buried in the modernization churn.
Open source code that is in active use really shouldn't be "pro" "mixed convention" codebase. It also shouldn't comingle convention changes with unrelated feature/functional changes. It's friction and generally counterproductive for adoption of the source code.
I'm somewhat surprised that Google policy prefers such chaos.