David -
> On Feb 25, 2017, at 3:00 PM,(David Adams) wrote:
>
> Subject: Re: Better variable names
Ahhhhh… naming standards… the Gordian Knot.
My two cents…
- the limited space available for a “name” needs to serve multiple purposes
- First… if it works for you, use it
- Second… consistency—not exactly a human strong point—is all important. No
scheme you use will work 100% of the time. Live with it. Embrace what works,
endure the edges.
- Third… consider the poor schlep who comes after you… who may be you
- if you like prefix, fine
- if you like suffix, fine… but don’t mix the two
- total agreement to have indicators—“_at”—to indicate appropriate actions for
this sort of thingy. Probably don’t want to be summing an “at”.
- use business terminology, rather than 4D/technical terms. The terms in a
business application are under 500, more likely 300.
- there are “internal glue” things that are appropriate for technical
terminology labels
- personally I like names to be in Major-to-Minor, Left-to-Right descending
order, related things sort together
Names_Company_at
Names_Country_at
Names_Pet_at
- Abbreviations… most likely necessary… have a list of “approved” & what they
mean.
which is it? no, num, nbr, nmr, nr
CUST = customer or customs?
- even better if there’s a “glossary”… Customer —> Cust —> “someone we do
business with” Organizations always have strange twists in how they use
terminology.
- if you need help with what acronyms mean, www.acronymfinder.com will provide
endless entertainment.
Personally I prefer the suffix format. But noticed the “b” prefix on form
buttons makes total sense to clump the buttons together. Much of good naming
is driven by the CONTEXT of what is being named.
- David Eddy
4D novice
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ: http://lists.4d.com/faqnug.html
Archive: http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub: mailto:[email protected]
**********************************************************************