Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project. We'll adopt some of the most-loved parts of Blink style in Chromium, especially the parts that allow writing less code, while adopting most of Chromium's naming and formatting guidelines in Blink.
- Argument names are optional in headers across all of Chromium. (This was already allowed, but it wasn't clear, so nobody had noticed.) Blink will keep requiring this; individual Chromium teams can adopt it if they want.
- We'll use Chromium naming guidelines for most of the codebase: file_names, member_names_, local_variable_names, ClassNames, etc. For functions, Chromium uses a mix of names_with_underscores() and CamelCase(), but Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().
Jeffrey
On Thu, Dec 10, 2015 at 3:07 PM, 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project. We'll adopt some of the most-loved parts of Blink style in Chromium, especially the parts that allow writing less code, while adopting most of Chromium's naming and formatting guidelines in Blink.Thanks for this work; I imagine the haggling wasn't fun and neither will be the irked comments you're bound to get, but it looks to me like a good compromise list. Two clarification questions:
- Argument names are optional in headers across all of Chromium. (This was already allowed, but it wasn't clear, so nobody had noticed.) Blink will keep requiring this; individual Chromium teams can adopt it if they want.
The Google style guide says these may be omitted "only if the parameter is unused and its purpose is obvious" (for both declarations and definitions), and since Chromium style doesn't add further notes, this is also the rule in Chromium. Blink is more lenient and allows even used parameters to have omitted names in the declaration, which I always found hard to read. Which policy will be used going forward, or will these continue to differ?
- We'll use Chromium naming guidelines for most of the codebase: file_names, member_names_, local_variable_names, ClassNames, etc. For functions, Chromium uses a mix of names_with_underscores() and CamelCase(), but Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().
If you're renaming files to file_name style, are you going to rename C++ source files from .cpp to .cc at the same time? Seems like if you're trying to be congruent with existing Chromium practice as well as the explicit Google style guide rules, this should happen, but you didn't explicitly mention it.
2) When files are renamed, should we ensure that #includes that change use a fully qualified path? I don't think there will be a lot of naming collisions, but there would be some, and having it read unambiguously would be nice.
Daniel
Jeffrey
On Thu, Dec 10, 2015 at 3:22 PM, Peter Kasting <pkas...@google.com> wrote:On Thu, Dec 10, 2015 at 3:07 PM, 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project. We'll adopt some of the most-loved parts of Blink style in Chromium, especially the parts that allow writing less code, while adopting most of Chromium's naming and formatting guidelines in Blink.Thanks for this work; I imagine the haggling wasn't fun and neither will be the irked comments you're bound to get, but it looks to me like a good compromise list. Two clarification questions:
- Argument names are optional in headers across all of Chromium. (This was already allowed, but it wasn't clear, so nobody had noticed.) Blink will keep requiring this; individual Chromium teams can adopt it if they want.
The Google style guide says these may be omitted "only if the parameter is unused and its purpose is obvious" (for both declarations and definitions), and since Chromium style doesn't add further notes, this is also the rule in Chromium. Blink is more lenient and allows even used parameters to have omitted names in the declaration, which I always found hard to read. Which policy will be used going forward, or will these continue to differ?The idea is that in a declaration, the parameters aren't used, so they can be omitted if their purpose is obvious.
> Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().Can we change it so that we just use jsStyle() as ever?The proposed rule doesn't look good to me because- We need to pay huge amount of cost to adopt the proposed rule, but it won't achieve consistency with Chromium.- We'll see inconsistency in each of files. e.g. Node::parentElement() (web-exposed) vs. Node::ParentElementOrShadowRoot() (internal)
On Thu, Dec 10, 2015 at 5:42 PM, TAMURA, Kent <tk...@chromium.org> wrote:> Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().Can we change it so that we just use jsStyle() as ever?The proposed rule doesn't look good to me because- We need to pay huge amount of cost to adopt the proposed rule, but it won't achieve consistency with Chromium.- We'll see inconsistency in each of files. e.g. Node::parentElement() (web-exposed) vs. Node::ParentElementOrShadowRoot() (internal)Yeah... Can we just make the code generator capitalize the method names so it's ParentNode() or leave stuff alone?
I worry about us ending up with name based variation too like parentNode() for web exposed, and ParentNode() for internal, where they have different return types.- E
These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*.
The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.
> Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().Can we change it so that we just use jsStyle() as ever?The proposed rule doesn't look good to me because- We need to pay huge amount of cost to adopt the proposed rule, but it won't achieve consistency with Chromium.
- We'll see inconsistency in each of files. e.g. Node::parentElement() (web-exposed) vs. Node::ParentElementOrShadowRoot() (internal)
> 2) When files are renamed, should we ensure that #includes that change use a fully qualified path? I don't think there will be a lot of naming collisions, but there would be some, and having it read unambiguously would be nice.I recommend to do it after moving Blink from third_party/WebKit to somewhere.
About the overall plan:These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*.This sounds reasonable to me.The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.How much are you going to be pushy about fixing the coding style in each directory? I'm asking this because this is going to distribute a ton of work to many teams and the opportunity cost is extremely high.
On Thu, Dec 10, 2015 at 5:42 PM, TAMURA, Kent <tk...@chromium.org> wrote:> Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().Can we change it so that we just use jsStyle() as ever?The proposed rule doesn't look good to me because- We need to pay huge amount of cost to adopt the proposed rule, but it won't achieve consistency with Chromium.Is the only inconsistency you're worried about that some functions (js implementations) will still use a different naming convention, or are there others?- We'll see inconsistency in each of files. e.g. Node::parentElement() (web-exposed) vs. Node::ParentElementOrShadowRoot() (internal)Some folks saw this as a good thing: web-exposed functions are different from C++-only functions, both in that you can't change them easily, and in that you can rely on your knowledge of the web platform to figure out their meaning.That said, if Blink folks in general want to uniformly start functions with capital letters and update the bindings generator, that's fine with me. I agree with Elliott that we wouldn't want to have functions named both parentNode() and ParentNode().
On Thu, Dec 10, 2015 at 6:37 PM, Jeffrey Yasskin <jyas...@google.com> wrote:On Thu, Dec 10, 2015 at 5:42 PM, TAMURA, Kent <tk...@chromium.org> wrote:> Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().Can we change it so that we just use jsStyle() as ever?The proposed rule doesn't look good to me because- We need to pay huge amount of cost to adopt the proposed rule, but it won't achieve consistency with Chromium.Is the only inconsistency you're worried about that some functions (js implementations) will still use a different naming convention, or are there others?- We'll see inconsistency in each of files. e.g. Node::parentElement() (web-exposed) vs. Node::ParentElementOrShadowRoot() (internal)Some folks saw this as a good thing: web-exposed functions are different from C++-only functions, both in that you can't change them easily, and in that you can rely on your knowledge of the web platform to figure out their meaning.That said, if Blink folks in general want to uniformly start functions with capital letters and update the bindings generator, that's fine with me. I agree with Elliott that we wouldn't want to have functions named both parentNode() and ParentNode().Elliott pointed out that we should probably add a feature to our clang plugin to block function names that differ only in case.
Hi blink-dev,
Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project.
tl,dr;- is this a proposal, or a 'happening thing?'
- are compromises being made in other Chrome projects?
- communication about this upcoming impact hasn't been effective
On Fri, Dec 11, 2015 at 10:07 AM 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:Hi blink-dev,
Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project.Is this a 'definitely going ahead' thing? I (just) finished reading the last thread about this and it finished with "I'm trying to work out a proposal with the folks in styleguide/c++/OWNERS, which we'll bring back to here andchromium-dev. " (https://groups.google.com/a/chromium.org/d/msg/blink-dev/4oqLbzyMWLE/0HB8MbJqAwAJ). Is this that proposal?
Unifying coding standards is a great goal. This means compromises. I don't see any compromises/changes being suggested for Chromium's style guide?
For something that seriously affects every single engineer on Chrome projects every single day, I don't think the communication has been effective. For example, today was actually the first day that most engineers in my office heard that Blink was going to move to 80 cols.
I understand it's been something of a topic of water cooler discussion in other offices (eg SFO), but that hadn't filtered through to us. Something's not worked here.I've dug through the archives and found a link to a form in another thread. I heard there were something like 80 responses? For the hundreds of engineers working on the Chrome projects, that kinda indicates it wasn't widely known - it was trying to survey all Chrome engineers yeah? For something of this magnitude, at a least a top level thread (like this one!) with an attention grabbing subject (like this one!) asking for feedback on a concrete proposal (like this one!) would have been great. If that is the purpose of this email, I've misunderstood, and I thank you.
On Thu, Dec 10, 2015 at 6:13 PM, Kentaro Hara <har...@chromium.org> wrote:About the overall plan:These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*.This sounds reasonable to me.The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.How much are you going to be pushy about fixing the coding style in each directory? I'm asking this because this is going to distribute a ton of work to many teams and the opportunity cost is extremely high.Not very pushy. If it's done in 6 months, I'd be pleasantly surprised. It'd also be best to get a smallish set of volunteers to make the changes, and let the directory owners tell them when's most convenient. That way the few volunteers can learn the pitfalls instead of each directory's owners having to learn independently. We need enough volunteers to avoid burning them out though.
JeffreyOn Fri, Dec 11, 2015 at 11:07 AM, Kentaro Hara <har...@chromium.org> wrote:On Fri, Dec 11, 2015 at 11:04 AM, Elliott Sprehn <esp...@chromium.org> wrote:On Thu, Dec 10, 2015 at 5:42 PM, TAMURA, Kent <tk...@chromium.org> wrote:> Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().Can we change it so that we just use jsStyle() as ever?The proposed rule doesn't look good to me because- We need to pay huge amount of cost to adopt the proposed rule, but it won't achieve consistency with Chromium.- We'll see inconsistency in each of files. e.g. Node::parentElement() (web-exposed) vs. Node::ParentElementOrShadowRoot() (internal)Yeah... Can we just make the code generator capitalize the method names so it's ParentNode() or leave stuff alone?We can do that, and I think we should. Only WebIDL uses parentNode(). All C++ methods use ParentNode().I worry about us ending up with name based variation too like parentNode() for web exposed, and ParentNode() for internal, where they have different return types.- E--Kentaro Hara, Tokyo, Japan--Kentaro Hara, Tokyo, Japan
On Thu, Dec 10, 2015 at 7:03 PM, Mike Lawther <mikel...@chromium.org> wrote:tl,dr;- is this a proposal, or a 'happening thing?'My read: somewhere between the two; it's at least a proposal and might've transitioned to a 'happening thing' if there hadn't been any push back :).- are compromises being made in other Chrome projects?
There are changes being proposed that will affect non-Blink Chrome code: see the first two bullets.
- communication about this upcoming impact hasn't been effectiveOn Fri, Dec 11, 2015 at 10:07 AM 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:Hi blink-dev,
Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project.Is this a 'definitely going ahead' thing? I (just) finished reading the last thread about this and it finished with "I'm trying to work out a proposal with the folks in styleguide/c++/OWNERS, which we'll bring back to here andchromium-dev. " (https://groups.google.com/a/chromium.org/d/msg/blink-dev/4oqLbzyMWLE/0HB8MbJqAwAJ). Is this that proposal?Yes.Unifying coding standards is a great goal. This means compromises. I don't see any compromises/changes being suggested for Chromium's style guide?See above.For something that seriously affects every single engineer on Chrome projects every single day, I don't think the communication has been effective. For example, today was actually the first day that most engineers in my office heard that Blink was going to move to 80 cols.I believe this thread is the first broad discussion of the conclusions, at least it's the first I've seen of it. You're not that far out of the loop :).I understand it's been something of a topic of water cooler discussion in other offices (eg SFO), but that hadn't filtered through to us. Something's not worked here.I've dug through the archives and found a link to a form in another thread. I heard there were something like 80 responses? For the hundreds of engineers working on the Chrome projects, that kinda indicates it wasn't widely known - it was trying to survey all Chrome engineers yeah? For something of this magnitude, at a least a top level thread (like this one!) with an attention grabbing subject (like this one!) asking for feedback on a concrete proposal (like this one!) would have been great. If that is the purpose of this email, I've misunderstood, and I thank you.80 responses actually strikes me as pretty good given the average response rate of surveys :).-- Dirk
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
On Fri, Dec 11, 2015 at 2:24 PM Dirk Pranke <dpr...@chromium.org> wrote:On Thu, Dec 10, 2015 at 7:03 PM, Mike Lawther <mikel...@chromium.org> wrote:tl,dr;- is this a proposal, or a 'happening thing?'My read: somewhere between the two; it's at least a proposal and might've transitioned to a 'happening thing' if there hadn't been any push back :).- are compromises being made in other Chrome projects?There are changes being proposed that will affect non-Blink Chrome code: see the first two bullets."will affect non-Blink Chrome code" is not the same as compromises. In particular, allowing new features (inline virtuals, optional argument names) doesn't actually require anyone to change the way they write code. The second bullet (optional argument names) was even already allowed by the Chromium guide, but just isn't used - which is precisely what is likely to happen with inline virtuals unless people already want to use them.In contrast, Blink engineers are being asked to conform to a restrictive new set of rules, and to change a number of familiar coding practices. *That's* a compromise. The asymmetry of requirements on Blink engineers vs Chromium engineers here is actually getting me quite upset.
On Fri, Dec 11, 2015 at 2:24 PM Dirk Pranke <dpr...@chromium.org> wrote:On Thu, Dec 10, 2015 at 7:03 PM, Mike Lawther <mikel...@chromium.org> wrote:tl,dr;- is this a proposal, or a 'happening thing?'My read: somewhere between the two; it's at least a proposal and might've transitioned to a 'happening thing' if there hadn't been any push back :).- are compromises being made in other Chrome projects?There are changes being proposed that will affect non-Blink Chrome code: see the first two bullets."will affect non-Blink Chrome code" is not the same as compromises. In particular, allowing new features (inline virtuals, optional argument names) doesn't actually require anyone to change the way they write code. The second bullet (optional argument names) was even already allowed by the Chromium guide, but just isn't used - which is precisely what is likely to happen with inline virtuals unless people already want to use them.In contrast, Blink engineers are being asked to conform to a restrictive new set of rules, and to change a number of familiar coding practices. *That's* a compromise. The asymmetry of requirements on Blink engineers vs Chromium engineers here is actually getting me quite upset.Google has a style guide that all Google (and many third-party) developers should already be familiar with.
Chromium (mostly) follows the Google style guide currently. Blink does not. Both projects are "owned" by Google. Consequently both projects should follow the Google style guide unless there are good (read: technical and not personal opinion) reasons to diverge. Do you disagree?
On Thu, Dec 10, 2015 at 5:42 PM, TAMURA, Kent <tk...@chromium.org> wrote:> Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().Can we change it so that we just use jsStyle() as ever?The proposed rule doesn't look good to me because- We need to pay huge amount of cost to adopt the proposed rule, but it won't achieve consistency with Chromium.Is the only inconsistency you're worried about that some functions (js implementations) will still use a different naming convention, or are there others?
- We'll see inconsistency in each of files. e.g. Node::parentElement() (web-exposed) vs. Node::ParentElementOrShadowRoot() (internal)Some folks saw this as a good thing: web-exposed functions are different from C++-only functions, both in that you can't change them easily, and in that you can rely on your knowledge of the web platform to figure out their meaning.That said, if Blink folks in general want to uniformly start functions with capital letters and update the bindings generator, that's fine with me. I agree with Elliott that we wouldn't want to have functions named both parentNode() and ParentNode().
On Thu, Dec 10, 2015 at 5:46 PM, TAMURA, Kent <tk...@chromium.org> wrote:> 2) When files are renamed, should we ensure that #includes that change use a fully qualified path? I don't think there will be a lot of naming collisions, but there would be some, and having it read unambiguously would be nice.I recommend to do it after moving Blink from third_party/WebKit to somewhere.Or maybe as part of moving out of third_party/WebKit? If a lot of files are being renamed anyway, this might be a good opportunity to get it all out of the way. We'll need similar tooling to help other developers migrate their patches across the change.--On Fri, Dec 11, 2015 at 8:07 AM, 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:Hi blink-dev,
Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project. We'll adopt some of the most-loved parts of Blink style in Chromium, especially the parts that allow writing less code, while adopting most of Chromium's naming and formatting guidelines in Blink. Specifically:We understand that many people will be upset about parts of these decisions. None of them were made lightly and this was the best compromise we could find based off the desires people expressed. Particularly, there was enough desire to end up with a shared style, even weighted by the number of Blink commits, that we had to find some compromise.
- Inline virtuals will be allowed, with some restrictions on when classes can have inline constructors and destructors.
- Argument names are optional in headers across all of Chromium. (This was already allowed, but it wasn't clear, so nobody had noticed.) Blink will keep requiring this; individual Chromium teams can adopt it if they want.
- We're pursuing google3 style changes to allow default arguments and mutable references, which would carry over to Chromium. If google3 rejects these, we'll discuss Chromium allowing them independently. Blink will continue allowing default arguments and mutable references at least until that's resolved.
- We'll use Chromium naming guidelines for most of the codebase: file_names, member_names_, local_variable_names, ClassNames, etc. For functions, Chromium uses a mix of names_with_underscores() and CamelCase(), but Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().
- Blink will adopt Chromium's 80-column limit and the rest of clang-format's Chromium formatting. The 80-column limit does not exempt us from the rule against abbreviation.
- Blink will maintain a short style guide for refinements to and differences from the overall Chromium style, and we'll aim to make this shorter over time.
These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*. The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.
JeffreyTAMURA Kent
Software Engineer, Google
On Fri, Dec 11, 2015 at 3:51 PM Marshall Greenblatt <magree...@gmail.com> wrote:On Fri, Dec 11, 2015 at 2:24 PM Dirk Pranke <dpr...@chromium.org> wrote:On Thu, Dec 10, 2015 at 7:03 PM, Mike Lawther <mikel...@chromium.org> wrote:tl,dr;- is this a proposal, or a 'happening thing?'My read: somewhere between the two; it's at least a proposal and might've transitioned to a 'happening thing' if there hadn't been any push back :).- are compromises being made in other Chrome projects?There are changes being proposed that will affect non-Blink Chrome code: see the first two bullets."will affect non-Blink Chrome code" is not the same as compromises. In particular, allowing new features (inline virtuals, optional argument names) doesn't actually require anyone to change the way they write code. The second bullet (optional argument names) was even already allowed by the Chromium guide, but just isn't used - which is precisely what is likely to happen with inline virtuals unless people already want to use them.In contrast, Blink engineers are being asked to conform to a restrictive new set of rules, and to change a number of familiar coding practices. *That's* a compromise. The asymmetry of requirements on Blink engineers vs Chromium engineers here is actually getting me quite upset.Google has a style guide that all Google (and many third-party) developers should already be familiar with.Counter-point: many Blink engineers were hired directly onto the Blink project and are far more familiar with the existing Blink style guide.
Many other third-party developers have no reason to be familiar with the Google style guide (though I appreciate that you do).
Chromium (mostly) follows the Google style guide currently. Blink does not. Both projects are "owned" by Google. Consequently both projects should follow the Google style guide unless there are good (read: technical and not personal opinion) reasons to diverge. Do you disagree?Well, yes. Blink is an open source project that multiple different companies collaborate on. There is no strong reason for it to conform to Google's guide.
There's also a strong argument for not making breaking changes without good technical reasons.
On Fri, Dec 11, 2015 at 3:51 PM Marshall Greenblatt <magree...@gmail.com> wrote:On Fri, Dec 11, 2015 at 2:24 PM Dirk Pranke <dpr...@chromium.org> wrote:On Thu, Dec 10, 2015 at 7:03 PM, Mike Lawther <mikel...@chromium.org> wrote:tl,dr;- is this a proposal, or a 'happening thing?'My read: somewhere between the two; it's at least a proposal and might've transitioned to a 'happening thing' if there hadn't been any push back :).- are compromises being made in other Chrome projects?There are changes being proposed that will affect non-Blink Chrome code: see the first two bullets."will affect non-Blink Chrome code" is not the same as compromises. In particular, allowing new features (inline virtuals, optional argument names) doesn't actually require anyone to change the way they write code. The second bullet (optional argument names) was even already allowed by the Chromium guide, but just isn't used - which is precisely what is likely to happen with inline virtuals unless people already want to use them.In contrast, Blink engineers are being asked to conform to a restrictive new set of rules, and to change a number of familiar coding practices. *That's* a compromise. The asymmetry of requirements on Blink engineers vs Chromium engineers here is actually getting me quite upset.Google has a style guide that all Google (and many third-party) developers should already be familiar with.Counter-point: many Blink engineers were hired directly onto the Blink project and are far more familiar with the existing Blink style guide. Many other third-party developers have no reason to be familiar with the Google style guide (though I appreciate that you do).
Chromium (mostly) follows the Google style guide currently. Blink does not. Both projects are "owned" by Google. Consequently both projects should follow the Google style guide unless there are good (read: technical and not personal opinion) reasons to diverge. Do you disagree?Well, yes. Blink is an open source project that multiple different companies collaborate on. There is no strong reason for it to conform to Google's guide.
There's also a strong argument for not making breaking changes without good technical reasons.
On Thu, Dec 10, 2015 at 7:03 PM, Mike Lawther <mikel...@chromium.org> wrote:tl,dr;- is this a proposal, or a 'happening thing?'- are compromises being made in other Chrome projects?- communication about this upcoming impact hasn't been effectiveOn Fri, Dec 11, 2015 at 10:07 AM 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:Hi blink-dev,
Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project.Is this a 'definitely going ahead' thing? I (just) finished reading the last thread about this and it finished with "I'm trying to work out a proposal with the folks in styleguide/c++/OWNERS, which we'll bring back to here andchromium-dev. " (https://groups.google.com/a/chromium.org/d/msg/blink-dev/4oqLbzyMWLE/0HB8MbJqAwAJ). Is this that proposal?Unifying coding standards is a great goal. This means compromises. I don't see any compromises/changes being suggested for Chromium's style guide?For something that seriously affects every single engineer on Chrome projects every single day, I don't think the communication has been effective. For example, today was actually the first day that most engineers in my office heard that Blink was going to move to 80 cols. I understand it's been something of a topic of water cooler discussion in other offices (eg SFO), but that hadn't filtered through to us. Something's not worked here.I've dug through the archives and found a link to a form in another thread. I heard there were something like 80 responses? For the hundreds of engineers working on the Chrome projects, that kinda indicates it wasn't widely known - it was trying to survey all Chrome engineers yeah? For something of this magnitude, at a least a top level thread (like this one!) with an attention grabbing subject (like this one!) asking for feedback on a concrete proposal (like this one!) would have been great. If that is the purpose of this email, I've misunderstood, and I thank you.I'm sorry Sydney doesn't feel like you had a chance to comment, and that the form didn't go out in a top-level message. Please do keep filling out https://goo.gl/forms/ChnS89os70.
Yes, this plan can still change if it looks like we've misjudged the sentiment of Blink overall. I think it's in about the right place, but if lots of people come back saying it's wrong (and the survey's how we quantify that), then it won't happen in the current form.
We had 50-60 responses before we started looking at how to merge the styles. I was trying to get a feel for Blink's opinion, not all of Chromium. Blink has had ~250 committers since the beginning of November (vs ~550 chromium folks who didn't touch Blink), and I don't expect most of the project to care about style, so that's not particularly out of line. The form originally went out in a thread titled "Reformatting blink with `clang-format -style=Chromium`", which I also expected to catch the attention of folks who cared about style.
The first three bullets of my email are compromises Chromium's making:
- Inline virtuals will be allowed, with some restrictions on when classes can have inline constructors and destructors.
- Argument names are optional in headers across all of Chromium. (This was already allowed, but it wasn't clear, so nobody had noticed.) Blink will keep requiring this; individual Chromium teams can adopt it if they want.
- We're pursuing google3 style changes to allow default arguments and mutable references, which would carry over to Chromium. If google3 rejects these, we'll discuss Chromium allowing them independently. Blink will continue allowing default arguments and mutable references at least until that's resolved.
(The change for default arguments is actually mailed and notionally approved, but it's not submitted yet.) I tried to get a 100 column limit across all of Chromium (to match Java and reduce the number of Blink changes), but too many Blink folks in the survey responses wanted to take Chromium's style wholesale to let me get that through.
Thanks for commenting,
Jeffrey
In contrast, Blink engineers are being asked to conform to a restrictive new set of rules, and to change a number of familiar coding practices. *That's* a compromise. The asymmetry of requirements on Blink engineers vs Chromium engineers here is actually getting me quite upset.
I'll reply in detail to the rest of the thread later, but I wanted to interject that "it's a Google project" wasn't part of any of these discussions. Shane's right: it's far from just a Google project. About 2/3 of new contributors come without Google experience, and we have to welcome them.
The bias in favor of the Chromium style guide (given that folks want to unify in the first place) is because it's the larger part of the project, so migrating Blink is cheaper, and Chromium uses the Google guide for historical reasons and because there's a perception that it reduces style discussions.
Jeffrey
we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*.
On Fri, 11 Dec 2015 00:07:17 +0100, 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*.If someone renames Melon.h to melon.h case insensitive filesystems will be unhappy (maybe git is better at handling it than in the past, maybe not).There are files like that: File.h, Blob.h, Editor.h, Event.h, ...
So, I took our interpretation to c-s...@google.com, and no one had a problem with it. The only reply it received was basically, to make reasonable judgements.
In particular, allowing non-const references seems like a disaster. It means whenever I call a function, my local variable might be silently mutated.
Switching Blink to use pointers instead of non-const references would require adding a bunch of null checks,
These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*. The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.
On Thu, Dec 10, 2015 at 3:07 PM, 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:
These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*. The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.Let's be a bit more organized than per-directory, distributed transition. The obviously failure mode here is that we'll end up with a psychotic code base that is half-pregnant with both styles.
On Tue, 15 Dec 2015 at 10:00 Dimitri Glazkov <dgla...@chromium.org> wrote:On Thu, Dec 10, 2015 at 3:07 PM, 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:
These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*. The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.Let's be a bit more organized than per-directory, distributed transition. The obviously failure mode here is that we'll end up with a psychotic code base that is half-pregnant with both styles.We don't *have* to end up with the exact same style in both parts. I think we should decide on a per-issue basis whether a) Chromium should change to match Blink style, b) Blink should change to match Chromium style, or c) it isn't worth the cost of migration and both parts should retain their historical style (possibly with a recommendation for new code, but old code doesn't have to migrate).
On Tue, 15 Dec 2015 at 10:00 Dimitri Glazkov <dgla...@chromium.org> wrote:On Thu, Dec 10, 2015 at 3:07 PM, 'Jeffrey Yasskin' via blink-dev <blin...@chromium.org> wrote:
These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*. The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.Let's be a bit more organized than per-directory, distributed transition. The obviously failure mode here is that we'll end up with a psychotic code base that is half-pregnant with both styles.We don't *have* to end up with the exact same style in both parts. I think we should decide on a per-issue basis whether a) Chromium should change to match Blink style, b) Blink should change to match Chromium style, or c) it isn't worth the cost of migration and both parts should retain their historical style (possibly with a recommendation for new code, but old code doesn't have to migrate).
In the case of non-const references, I would suggest that is quite harmful to allow (that is just my opinion, but it is backed up by years of Chromium and Google3 style rules). But I understand this is commonplace in Blink and it would be a tremendous overhead to "fix" all of the non-const references into pointers. So we should go with (c) on this. Perhaps recommend that new code in Blink prefers pointers over non-const refs, but ban it in non-Blink directories and allow it inside Blink for historical reasons.This doesn't have to be all or nothing.May I propose that, if we decide to do this, we:1) get a better handle on the total cost of the transition2) coordinate a scoped/small period of time in the future to do this transition?:DG<
--
Hi blink-dev,
Based on your feedback, Nico, Dana, and I have come up with a plan to converge Blink and Chromium style so that it's easier to work across both parts of our project. We'll adopt some of the most-loved parts of Blink style in Chromium, especially the parts that allow writing less code, while adopting most of Chromium's naming and formatting guidelines in Blink. Specifically:
- Inline virtuals will be allowed, with some restrictions on when classes can have inline constructors and destructors.
- Argument names are optional in headers across all of Chromium. (This was already allowed, but it wasn't clear, so nobody had noticed.) Blink will keep requiring this; individual Chromium teams can adopt it if they want.
- We're pursuing google3 style changes to allow default arguments and mutable references, which would carry over to Chromium. If google3 rejects these, we'll discuss Chromium allowing them independently. Blink will continue allowing default arguments and mutable references at least until that's resolved.
We understand that many people will be upset about parts of these decisions. None of them were made lightly and this was the best compromise we could find based off the desires people expressed. Particularly, there was enough desire to end up with a shared style, even weighted by the number of Blink commits, that we had to find some compromise.
- We'll use Chromium naming guidelines for most of the codebase: file_names, member_names_, local_variable_names, ClassNames, etc. For functions, Chromium uses a mix of names_with_underscores() and CamelCase(), but Blink will standardize on CamelCase(). However, C++ functions that implement JS functions get an exception and will be named in jsStyle().
- Blink will adopt Chromium's 80-column limit and the rest of clang-format's Chromium formatting. The 80-column limit does not exempt us from the rule against abbreviation.
- Blink will maintain a short style guide for refinements to and differences from the overall Chromium style, and we'll aim to make this shorter over time.
These are the long-term plans, but we'll stage the migration in a way that we hope is minimally disruptive to the project. Once https://crbug.com/563793 paves the way, we'd like to get volunteers to make 2 changes up-front: clang-formatting the code to 80 columns, and renaming files from ClassName.* to class_name.*. The rest of the changes are harder to automate, so we'll leave them to individual directory owners/contributors to schedule when it's convenient. Please add yourself to this spreadsheet if you own a directory or want to work on the conversion for one. Please don't "fix" things that aren't prohibited by the Chromium style guide; we want to get into a consistent state with as little churn as possible.
Jeffrey
I noticed that the new style guide didn't mention config.h. We need some effort to remove it.