What's the rule of thumb when it comes to naming fields?
I have been been naming like the following: ' TFLastName ' TF for Text Field and then what the field is.
Is it really necessary for me to begin the field in that manner?
Solved! Go to Solution.
Views
Replies
Total Likes
No it is not but it is good practice in that when you are reading code you can tell what the object type is simply by looking at the name.
Paul
Views
Replies
Total Likes
No it is not but it is good practice in that when you are reading code you can tell what the object type is simply by looking at the name.
Paul
Views
Replies
Total Likes
Thank you, you confirmed what I was thinking.
Views
Replies
Total Likes
Hi,
If you're adding the field type to each field name, you might also want to consider adding the field length to each field as that is even more crucial when populating forms. If the field expects special formatting as well, in order to avoid the form rejecting mal-formed data.
So eventually you'll end up with field names like num_ZipCode_6_XXX_XX, and what I'm really trying to say is: do not to mix in any meta data at all into the field name. The meta data, such as field type, field length or formatting already has a natural place: inside the schema. That's what it's for.
On the contrary, my experience is that prefixing each and every field name will add clutter and actually reduce readability of the xml.
As pguerett points out, it is good practise when writing Java or JavaScript. The reason is that Java code doesn't have schemas, but instead strict rules of how a variable can be typed (string, long, int, double, unsigned and so on). A developer just needs to know if a variable is a string or, in case of a number, if it has a sign.
The convention is usually called Hungarian notation (google it), but as I said, you don't need that in field names since they should have a schema.
I'm not mixing any meta data in the field names, strictly alpha characters, example: 'TFLastName'.
Yhanks.
Views
Replies
Total Likes
Views
Likes
Replies