abbrcode/abbreviations-in-code

"private"

philipeachille opened this issue · 15 comments

add "priv" for "private", e.g. privKey = 'some key'

T1xx1 commented

And "pub" for "public"?

I'd agree with "pub" for "public"

So far I used prv because it has the same length as pub but in google there are 900k results for "privkey" and 8k for "prvkey", so "priv" seems more widely used. My only concern with it  is that it makes 4 letters from 7. Not even the half length.

"pub" at least makes "public" half-length.

So I'm ok with "pub", but once we add it we need to add something for "private" too and it should be "priv" if it's more widely accepted.

What do you think?

T1xx1 commented

Idk. It's a hard choice.

However your half-length logic seem good to implement in the CONTRIBUTING.md as rule of significant of the paragraph of A good abbreviation is.

What about:
short • taking out one letter is not an abbreviation (target at least half length)

T1xx1 commented

Yeah, but we should still add it in the CONTRIBUTING.md.

And other thing I usually keep in mind is to not abbreviate words shorter than 6 characters because they are already short. What do you think about it?

T1xx1 commented

Yes, it makes sense. Adding this rule we must check for abbrs in the list which are shorter than 6 and mark them with the 🔴.

I'm opening a new issue for the CONTRIBUTING.md.

Great, thank you! ☺️

"not abbreviate words shorter than 6 characters"
-> I would not put that limitation on this repo. That's an individual choice I think.

"Not even the half length."
-> I think that this is not a concern. For me - using priv as example - it's also about syllables: priv is one private is two (there is your half)
-> Again, I would not put that limitation on this repo.

In the past, Rust had "priv" as a keyword (not "prv", although it has "pub"): https://www.google.com/search?q="rust"+"priv". It was removed, but not because it was a bad abbreviation.

To stick with original topic, I think "pub" and "priv" are well know and we should add them as green.

For the rules we will open a new issue to discuss them. Anyway, the syllable counting seems like an interesting approach.

So we settle on "pub" and "priv"?

i think they go well together because of both being one syllable

T1xx1 commented

So we settle on "pub" and "priv"?

i think they go well together because of both being one syllable

Yep, can you do it?

opened PR #29