abbrcode / abbreviations-in-code

The list of common abbreviations in program codes.
https://abbreviations-in-code.vercel.app
MIT License
426 stars 52 forks source link

"private" #23

Closed philipeachille closed 1 year ago

philipeachille commented 1 year ago

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

T1xx1 commented 1 year ago

And "pub" for "public"?

philipeachille commented 1 year ago

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

kisvegabor commented 1 year ago

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 1 year ago

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.

kisvegabor commented 1 year ago

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

T1xx1 commented 1 year ago

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

kisvegabor commented 1 year ago

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 1 year ago

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.

kisvegabor commented 1 year ago

Great, thank you! :relaxed:

philipeachille commented 1 year ago

"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.

h-h-h-h commented 1 year ago

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.

kisvegabor commented 1 year ago

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.

philipeachille commented 1 year ago

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

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

T1xx1 commented 1 year ago

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

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

Yep, can you do it?

philipeachille commented 1 year ago

opened PR #29