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

"function", "vertical" #19

Closed h-h-h-h closed 1 year ago

h-h-h-h commented 1 year ago

"function", current entry:

🟢 f / func • function

But in Rust and laptop keyboards, it's fn. I've also seen it in code in other languages as an identifier where fn isn't a keyword.


"vertical", current entry:

🟢 ver • version / vertical

I don't think the green circle is valid for both meanings, specifically not for "vertical". According to this page, "vert." is much more popular than "ver." for "vertical".


🟢 num • number

"num" also stands for "number of" (count) as in numElements.


🟢 e.g. • example

This seems unnecessary in this list. And "e.g." isn't just "example", but "for example". Isn't "ex." the abbreviation for "example"?


Shouldn't some abbreviations be all-caps?

🟢 pr • pull request

T1xx1 commented 1 year ago

"function", current entry:

🟢 f / func • function

But in Rust and laptop keyboards, it's fn. I've also seen it in code in other languages as an identifier where fn isn't a keyword.

I think fn is too similar to ln, you might get confused.


"vertical", current entry:

🟢 ver • version / vertical

I don't think the green circle is valid for both meanings, specifically not for "vertical". According to this page, "vert." is much more popular than "ver." for "vertical".

I tried to keep it the same length as hor • horizontal but vert is better.


🟢 num • number

"num" also stands for "number of" (count) as in numElements.

But it's not wrong. We can add "(of)" after but it doesn't change the meaning.


🟢 e.g. • example

This seems unnecessary in this list. And "e.g." isn't just "example", but "for example". Isn't "ex." the abbreviation for "example"?

I have personally never seen "ex" as "example".


Shouldn't some abbreviations be all-caps?

🟢 pr • pull request

It's easier to use lowercase, but it still doesn't change the meaning. This seems not correct to me. In the contributing file, num 2 says:

"Don't list acronyms (e.g. RAM, CPU, SQL) or conventions (i, j, k for iterators)."

pr is not an abbreviation but an acronym so it should not be on this list. @kisvegabor

h-h-h-h commented 1 year ago

I think fn is too similar to ln, you might get confused.

How did you come up with ln?! I've seen it as an abbreviation for "line", which could also be added (e.g., in Java's println()). fn and ln will each be used in their own context, though.

But it's not wrong. We can add "(of)" after but it doesn't change the meaning.

That's what I was up to. I can't say anything about the meaning "number", but "number of" should definitely be added. I had the text number [of] in mind. number / number of would also be possible.

I have personally never seen "ex" as "example".

"e.g. • example" is definitely wrong. And what does it have to do with programming abbreviations? It stands in the context of natural language. Here and here are sources for "ex.", BTW.

T1xx1 commented 1 year ago

I think fn is too similar to ln, you might get confused.

How did you come up with ln?! I've seen it as an abbreviation for "line", which could also be added (e.g., in Java's println()). fn and ln will each be used in their own context, though.

I still don't see the point of it but it doesn't change my life adding another one. It's losing the point of 🟢 tho.


But it's not wrong. We can add "(of)" after but it doesn't change the meaning.

That's what I was up to. I can't say anything about the meaning "number", but "number of" should definitely be added. I had the text number [of] in mind. number / number of would also be possible.

Better keep plain text number of.


I have personally never seen "ex" as "example".

"e.g. • example" is definitely wrong. And what does it have to do with programming abbreviations? It stands in the context of natural language. Here and here are sources for "ex.", BTW.

e.g. comes from Latin and it literally means example. Here. It can be used in comments when explaining the code with examples.

h-h-h-h commented 1 year ago

It's losing the point of 🟢 tho.

There could be multiple entries with differing left side and same right side (in this case "function"). Then, each can get its own color. (This is also what I was referring to when talking about "🟢 ver • version / vertical", before you said "vert." is better.)

e.g. comes from Latin and it literally means example.

If you translate "e.g." with "example", you ignore "g.". It's wrong, because it means "for example". Your link also explains it as "for the sake of an example".

It can be used in comments when explaining the code with examples.

How is having "e.g." in the list different than having other well-known natural-language abbreviations like "etc." in the list? I don't think this list is about these types of abbreviations. The rest of the list is about abbreviations that can be used in identifiers and such, not in sentences.

kisvegabor commented 1 year ago

"function", current entry: :green_circle: f / func • function

Actually I'm ok with fn as it's also well known abbreviation. We should think about what is the goal of this repo. IMO we shouldn't write a standard here, but collect abbreviations that make sense.

"vertical", current entry: :green_circle: ver • version / vertical

I'm coming from the UI industry and use hor/ver a lot for resolution. I feel that ver is better just because it has the same length as hor. But it's kind of subjective. I was surprised that vert was voted as more popular.

:green_circle: num • number "num" also stands for "number of" (count) as in numElements.

I agree to change it to "num • number / number of". E.g. numUsers -> number of users is quite common.

:green_circle: e.g. • example This seems unnecessary in this list. And "e.g." isn't just "example", but "for example". Isn't "ex." the abbreviation for "example"?

I also agree that e.g. is not good for programming as it has a points in it. You can not have a variable or function name like loadE.g.Page. Instead loadExPage.

Shouldn't some abbreviations be all-caps? :green_circle: pr • pull request

Actually it might already violate our rule:

Don't list acronyms (e.g. RAM, CPU, SQL)

philipeachille commented 1 year ago

i suggest we should open individual issues for each abbrev to be discussed