Thanks Pat and Arnaud,

Seems it’s common to include datatype in variable/field names, whether it’s 
prefix or suffix is a matter of style. I find it very useful to know at a 
glance the type of an object, so I use a similar “modified Hungarian” notation 
too. For booleans I use the “is” prefix, which kinda breaks the rule, but reads 
so very logically. 

A few years ago I stopped differentiating between integer and longInt, since 4D 
stopped. Likewise for string and text which 4D treats the same (except for when 
they are arrays).

I’m a fan of camelCase rather than underscores for word breaks, mainly for 
economy, but I like underscores after module prefixes in method names.

> On Dec 14, 2018, at 07:48, Pat Bensky via 4D_Tech <[email protected]> 
> wrote:
> We have a fairly simple but effective set of rules for naming variables.
> 
> Begin each variable name with a character to specify what type it is:
> 

> On Dec 14, 2018, at 08:11, Arnaud de Montard via 4D_Tech 
> <[email protected]> wrote:
> we're using something similar for variables (except it's suffixes: myText_t, 
> myDate_d, myTwoDimentionalArrayText_a2t, myObject_o, etc.)

And I like Arnaud’s convention for tables and fields:
> 
> Structure items 
> - tables uppercase
> - fields camelCase
> - primary keys "PK"
> - foreign keys "FK_primaryKeyTableName"
> - relations 1 to N "tableNname__F" (foreign)
> - relations N to 1 "table1name__P" (primary)
> 


I’d be interested in more comments about UI standards. I’ve often wished that 
4D allowed the creation of custom form ‘templates’. I know that 4D has built-in 
form templates, button etc, but I’ve never found them appealing and the 
templates didn't support for dialog forms very well.

Also, Coding Style is a very big universe and many books are written on the 
subject. I got Steve Connoly's Code Complete many years ago and found it to be 
a great source of guidance. 

Tom

**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to