--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
This comes up on c-style periodically. The style guide was updated (in the past year, I think) to prefer StartRpc(). I don’t like this guidance, I prefer URL and UI in names, but maybe the reason we have style guides in the first place is to keep people like us from painting bikesheds all day long.(Peter, your style guide link is outdated, but you’re forgiven because the redirect from codesite isn’t very effective.)
This comes up on c-style periodically. The style guide was updated (in the past year, I think) to prefer StartRpc(). I don’t like this guidance, I prefer URL and UI in names, but maybe the reason we have style guides in the first place is to keep people like us from painting bikesheds all day long.
Many acronyms are read as words. Like NASA is read "nah-sah" not "N. A. S. A." I think that's probably related to making them lowercase like words.UI is different, you say that by saying each letter. Writting that as Ui would suggest you are saying something completely different. It's weird. :/
But whatever it is, being inconsistent with the same word (2) is probably the worst possible outcome of this thread IMO.
On Tue, Oct 27, 2015 at 4:16 PM, 'Peter Kasting' via Chromium-dev <chromi...@chromium.org> wrote:On Tue, Oct 27, 2015 at 4:07 PM, Mark Mentovai <ma...@chromium.org> wrote:This comes up on c-style periodically. The style guide was updated (in the past year, I think) to prefer StartRpc(). I don’t like this guidance, I prefer URL and UI in names, but maybe the reason we have style guides in the first place is to keep people like us from painting bikesheds all day long.(Peter, your style guide link is outdated, but you’re forgiven because the redirect from codesite isn’t very effective.)I didn't realize there was a new location for the up-to-date guide, thanks!That text definitely clarifies things, even though they use "acronym" there where I think they mean any abbreviation (since "RPC" is an initialism). Like you and Michael, I would prefer the rule some other way, but if the guide is going to be explicit about this I'll obey it.So, given that the rule is "Prefer to capitalize as words", what shall we do in our codebase?(1) Globally convert things to this naming style(2) Don't change existing code just to change it, but if touching it anyway, and in any new code, use this style(3) Ignore the style rule for some set of things (abbreviations where we're pretty consistent about being the other way?)I would imagine people would prefer (2), as (1) is a lot of churn, and (3) feels like we're not obeying the style guide.Many acronyms are read as words. Like NASA is read "nah-sah" not "N. A. S. A." I think that's probably related to making them lowercase like words.
UI is different, you say that by saying each letter. Writting that as Ui would suggest you are saying something completely different. It's weird. :/
And there will always be some weird exception or different case. For example GraphicsContext3d? Or GraphicsContext3D? Here you say the D letter as a letter of its own again.But whatever it is, being inconsistent with the same word (2) is probably the worst possible outcome of this thread IMO.
On Tue, Oct 27, 2015 at 4:36 PM, Peter Kasting <pkas...@google.com> wrote:On Tue, Oct 27, 2015 at 4:33 PM, Dana Jansens <dan...@chromium.org> wrote:On Tue, Oct 27, 2015 at 4:24 PM, Peter Kasting <pkas...@google.com> wrote:On Tue, Oct 27, 2015 at 4:22 PM, Dana Jansens <dan...@chromium.org> wrote:Many acronyms are read as words. Like NASA is read "nah-sah" not "N. A. S. A." I think that's probably related to making them lowercase like words.UI is different, you say that by saying each letter. Writting that as Ui would suggest you are saying something completely different. It's weird. :/Yes, this distinction is what I was trying to highlight by using "acronym" ("pronounced as a word") distinctly from the superset "abbreviation" (also covers initialisms).But whatever it is, being inconsistent with the same word (2) is probably the worst possible outcome of this thread IMO.Does that mean you're suggesting we do (3) then?Yes, I agree with everything Nico said.Ah, I didn't perceive Nico as voting for (3), but rather voting for "don't bother about enforcing this rule or the lack thereof". (Which is an outcome I'm probably pathologically unable to personally implement.)I guess I read them as similar. Prefer using ThisStyle cuz it's nicer usually. Some places people will hate it (eg Ui bothers me :P), and it's not worth arguing about. :)
On Tue, Oct 27, 2015 at 4:07 PM, Mark Mentovai <ma...@chromium.org> wrote:This comes up on c-style periodically. The style guide was updated (in the past year, I think) to prefer StartRpc(). I don’t like this guidance, I prefer URL and UI in names, but maybe the reason we have style guides in the first place is to keep people like us from painting bikesheds all day long.This guidance makes sense to me. I always mention the Objective-C class NSHTTPURLResponse as a good example why capitalized abbreviations are a bad idea – NSHttpUrlResponse is much easier to read.
Many acronyms are read as words. Like NASA is read "nah-sah" not "N. A. S. A." I think that's probably related to making them lowercase like words.UI is different, you say that by saying each letter. Writting that as Ui would suggest you are saying something completely different. It's weird. :/
I think these could be left to the judgement of reviewers.
On Tue, Oct 27, 2015 at 5:04 PM Thiago Farina <tfa...@chromium.org> wrote:I think these could be left to the judgement of reviewers.Lots of people disagree with some specific rule in the style guide and think that rule should be up to individual judgement (so that they can choose not to follow it). The premise of having a style guide is that we don't do that, and instead we all follow the guide. The "Rpc" example in the guide makes the intent clear, even if the word choice is confusing.I definitely think we should do 2 (or at least the slightly weaker version of 2 that Peter proposed). Option 3 pretty much guarantees a series of arguments in the future about exactly which things should be exempted, and would make the style guide harder to learn since everyone would need to learn the list of exceptions. (And since people would forget what the exceptions are sometimes, the codebase would probably not become much more consistent over time.)
I think it will just become more inconsistent over the time (silos are formed by different teams). People will let both forms of Url/URL go in for sure.
Not every reviewer will or remember to enfore 'Url' over 'URL' for example.
People are already allowing fooBar (instead of foo_bar) in C++ code, what more can we say :)
Another position is that abbreviations are always words, and thus our existing spelling of "UI" is globally wrong; we therefore need to decide whether to change it globally or just use "Ui" in new code (presumably the latter).
I think it will just become more inconsistent over the time (silos are formed by different teams). People will let both forms of Url/URL go in for sure. Not every reviewer will or remember to enfore 'Url' over 'URL' for example.
On Tue, Oct 27, 2015 at 8:50 PM, 'Peter Kasting' via Chromium-dev <chromi...@chromium.org> wrote:Another position is that abbreviations are always words, and thus our existing spelling of "UI" is globally wrong; we therefore need to decide whether to change it globally or just use "Ui" in new code (presumably the latter).Peter, are you in favor of using 'Ui' in new code? The style guide says 'Use common sense and BE CONSISTENT.' . My understand from that is if we already have classes being named with UI, new code would be named using 'UI' too. Why deviate?
--
Is this the same story for JavaScript? Web APIs seem to mostly use uppercase, e.g. "HTMLElement" or "encodeURIComponent".BTW, this actually can be awkward in our extensions API, or in generated code in general. Suppose an extension IDL defines a type using uppercase URL:dictionary Results {DOMString someURLScheme;DOMString[] dataURLs;}The generated C++ extensions code will define the Results class with these members:std::string some_url_scheme; // Fine.std::vector<std::string> data_ur_ls; // Crap.
#include
s only work properly when your code is consistent with the expectations of the tooling. In many cases, rules that are attributed to "Be Consistent" boil down to "Just pick one and stop worrying about it"; the potential value of allowing flexibility on these points is outweighed by the cost of having people argue over them.--