From: Rouben Rostamian on
On 2010-02-10, Daniel <google-cal(a)ehdp.com> wrote:
> It would be helpful for me to have an abbreviation of the word
> "array".
> Or an abbreviation for an alternate word that means the same thing.
> I use the word "array" as used in C, Java, or any standard language.
> ...
> But I also find special abbreviations often to be more memorable and
> useful, such as cnt for count, ndx for index, pck for pick, lo / hi
> for
> low / high, var for variable, rng for range, max / min, etc. And I
> have some variable names that are so long that it would help me to try
> abbreviating "array".

How about "a"?

This issue was solved centuries ago in mathematics. All
variables are single-letter names. The quadratic equation
is written as:

a x^2 + b x + c = 0,

not

first_coeff * unknown^2
+ second_coeff * unknown
+ constant_term = 0.

In matrix algebra, an array is denoted by a single letter, say "a",
and the array's generic term is a[i]. Making it arr[ndx] just
muddies things.

--
Rouben Rostamian

From: root on
Daniel <google-cal(a)ehdp.com> wrote:
> I was thinking "ara" or "ary", but am not that excited about them,
> maybe because they have two syllables or maybe because I
> (and others) am not used to them.
>
> Any thoughts? Is there a standard or suggested way to abbreviate
> the word "array"? I looked in "Code Complete" and searched the
> internet and found very little mention.
>
> Thanks,
> Daniel

I would suggest ra
From: Daniel on
On Feb 10, 10:11 pm, root <NoEM...(a)home.org> wrote:
> Daniel <google-...(a)ehdp.com> wrote:
> > I was thinking "ara" or "ary", but am not that excited about them,
> > maybe because they have two syllables or maybe because I
> > (and others) am not used to them.
>
> > Any thoughts? Is there a standard or suggested way to abbreviate
> > the word "array"? I looked in "Code Complete" and searched the
> > internet and found very little mention.
>
> > Thanks,
> > Daniel
>
> I would suggest ra

Thanks for the replies and suggestions.

I had hoped there was some standard, because it's
better to use coding conventions that others understand.
My guess is there is no standard.

I think any almost any programmer would understand
hi / lo / cnt / ndx / max / min. I don't think it's quite as
obvious what arr / ray / vec / ra mean.

Just to clarify for Rouben, I'm not using the word "array" by
itself, or in a short name. In that case, it would be silly to
abbreviate. I'm using the word in combination with other words
in a much longer variable name, with multiple concepts in the
same name. As one example of many in the software:
"RWA_CAT_Set_HiPckNdx_Array_g". I need to trim two
characters to meet an internal coding standard. "Array"
is the likely victim.

As somewhat suggested, I could just use the single letter "a" in
the longer variable name to indicate an array, akin to Hungarian. But
I think using just one letter would be too obscure, especially for a
var name that is already pretty complicated and hard to understand.
And the program already uses many 3-character short-hands to
categorize variable types (CAT=category, RNG=range, TBL=table,
CHT=chart, etc), so I'd prefer to continue the convention.

The RWA_CAT_Set_HiPckNdx_Array_g example is a read-write
array (indicated by RWA). But, on reflection, it's actually an array
of pointers, not an array of arrays (which I was implying by saying
"Array"). Each pointer points to a read-write array (each element
is a "high pick index" for a "categorical set"). I apologize for the
detail. The point is another possibility is to use the well-known
abbreviation "Ptr" in place of "Array", since the concept is "pointer
to array". This would avoid the naming issue, but lose the
information
that behind the pointer is an array.

Another choice is to use RWA for "array". I already consistently use
RWA to start certain variable names. A negative is you can't easily
pronounce RWA. But it is pretty easily recognizable, at least to me.
My guess is others would pretty easily understand RWA (read-write
array) and ROA (read-only array), but I don't really know.

So I'm be thinking about the following choices, especially the last
three:

RWA_CAT_Set_HiPckNdx_Array_g - Original name. Need to trim by 2
RWA_CAT_Set_HiPckNdx_A_g - Too obscure? It's certainly short.
RWA_CAT_Set_HiPckNdx_Ra_g - Not personally attracted to this one
RWA_CAT_Set_HiPckNdx_Vec_g - Many people don't know what vector is.
RWA_CAT_Set_HiPckNdx_Ray_g - Not bad, but I like arr better.

RWA_CAT_Set_HiPckNdx_Arr_g - Kind of like it (ARR! ARR! ARR!)
RWA_CAT_Set_HiPckNdx_Ptr_g - Avoid naming issue. Use different
concept.
RWA_CAT_Set_HiPckNdx_RWA_g - Extend existing internal convention

Thanks,
Daniel
From: Nick Keighley on
On 11 Feb, 06:52, Daniel <google-...(a)ehdp.com> wrote:
> On Feb 10, 10:11 pm, root <NoEM...(a)home.org> wrote:
> > Daniel <google-...(a)ehdp.com> wrote:

[need an abbreviation for "array"]

> > > I was thinking "ara" or "ary", but am not that excited about them,
> > > maybe because they have two syllables or maybe because I
> > > (and others) am not used to them.
>
> > > Any thoughts? Is there a standard or suggested way to abbreviate
> > > the word "array"? I looked in "Code Complete" and searched the
> > > internet and found very little mention.

I think this s fundamantally a bad idea. It's slipping and sliding
towards Hungarian. I's suggest the ultimate abbreviation either "s" OR
NOTHING AT ALL.

say we have a type BaseStation. Then an array of basestations might be
BaseStation base_stations [MAX_BS];
or even
BaseStation base_station [MAX_BS];

I like the singular because I can write things like
process (base_station [n]);

the down side is I have to invent another name for a single base
station.

> > I would suggest ra

yuk


> Thanks for the replies and suggestions.
>
> I had hoped there was some standard, because it's
> better to use coding conventions that others understand.
> My guess is there is no standard.

no, and too much disagreement


> I think any almost any programmer would understand
> hi / lo / cnt / ndx / max / min. I don't think it's quite as
> obvious what arr / ray / vec / ra mean.

I prefer i or j for ndx and I'm not keen on cnt (too near a rude
english word)


> Just to clarify for Rouben, I'm not using the word "array" by
> itself, or in a short name. In that case, it would be silly to
> abbreviate. I'm using the word in combination with other words
> in a much longer variable name, with multiple concepts in the
> same name.

arg! It's a Hungarian! Burn him!


> As one example of many in the software:
> "RWA_CAT_Set_HiPckNdx_Array_g".

very like the sound I make when I see something like that. Or eat
somethign bad. I assume the prefix is some sort of namespace (a bit
long I'd say).

RWA_CAT_hi_pick_indexs
RWA_CAT_hi_pick_indices
RWA_CAT_hi_pick_index
RWA_CAT_hi_pick_index_table
RWA_CAT_hi_pick_index_list

I prefer table/list to array as it seems less implementy. I hope the
trailing _g doesn't indicate GLOBAL DATA... [can we burn him /twice/?
he's gone all crispy]


> I need to trim two
> characters to meet an internal coding standard. "Array"
> is the likely victim.

_g is two characters...


> As somewhat suggested, I could just use the single letter "a" in
> the longer variable name to indicate an array, akin to Hungarian. But
> I think using just one letter would be too obscure,

unlike RWA_CAT_Set_HiPckNdx_Array_g

> especially for a
> var name that is already pretty complicated and hard to understand.
> And the program already uses many 3-character short-hands to
> categorize variable types (CAT=category, RNG=range, TBL=table,
> CHT=chart, etc), so I'd prefer to continue the convention.
>
> The RWA_CAT_Set_HiPckNdx_Array_g example is a read-write
> array (indicated by RWA). But, on reflection, it's actually an array
> of pointers, not an array of arrays (which I was implying by saying
> "Array"). Each pointer points to a read-write array (each element
> is a "high pick index" for a "categorical set"). I apologize for the
> detail.

no it helps
categorical_set_high_pick_index

drop all the junk


> The point is another possibility is to use the well-known
> abbreviation "Ptr" in place of "Array", since the concept is "pointer
> to array". This would avoid the naming issue, but lose the
> information
> that behind the pointer is an array.


I don't like ptr (or anything else that indicates a pointer). C uses a
* to indicate its a pointer and that's good enough for me. If you
don't use global data then your variables will be defined nearby.

> Another choice is to use RWA for "array". I already consistently use
> RWA to start certain variable names. A negative is you can't easily
> pronounce RWA.

except in glasgow


> But it is pretty easily recognizable, at least to me.
> My guess is others would pretty easily understand RWA (read-write
> array) and ROA (read-only array), but I don't really know.
>
> So I'm be thinking about the following choices, especially the last
> three:
>
> RWA_CAT_Set_HiPckNdx_Array_g - Original name. Need to trim by 2
> RWA_CAT_Set_HiPckNdx_A_g - Too obscure? It's certainly short.
> RWA_CAT_Set_HiPckNdx_Ra_g - Not personally attracted to this one
> RWA_CAT_Set_HiPckNdx_Vec_g - Many people don't know what vector is.
> RWA_CAT_Set_HiPckNdx_Ray_g - Not bad, but I like arr better.
>
> RWA_CAT_Set_HiPckNdx_Arr_g - Kind of like it (ARR! ARR! ARR!)
> RWA_CAT_Set_HiPckNdx_Ptr_g - Avoid naming issue. Use different
> concept.
> RWA_CAT_Set_HiPckNdx_RWA_g - Extend existing internal convention

From: bartc on
Daniel wrote:
> On Feb 10, 10:11 pm, root <NoEM...(a)home.org> wrote:

> same name. As one example of many in the software:
> "RWA_CAT_Set_HiPckNdx_Array_g". I need to trim two
> characters to meet an internal coding standard. "Array"
> is the likely victim.

I often use "list" or "lst"; they're both somewhat shorter than "array" (and
a bit easier to type for some reason). Perhaps "set" if not inappropriate.
Or "Ax" if you don't want to lose sight of "Array".

Or you could try getting rid of some underlines: you don't need both
underlines and mixed case.

--
bartc