A person’s name is the sweetest sound to them in any language. Even in a crowded noisy room, you’ll probably hear your name called out over all the din.
Can you relate to when you share a name with someone? Someone calls out your name “Hey Chris” and you and a different Chris look over at that person and wave? A little bit embarrassing if it’s not you and a little bit inefficient. The world would be more efficient if we had unique names but conversations would be difficult:
“Hi fingerprint ID 0010010101”
“Oh how’s it going fingerprint ID 1001010110?”
“Good man. Good. Happy New Year to you and your wife fingerprint ID 010111010111”
It’s much better when we can use terms such as Cassy, Andrew and Fernando* right?
The development world is a bit like this. Beneath the scenes, everything is referred to using a unique code but we as humans can’t handle this so we’ve made life easier for ourselves by giving items names that make sense to us.
Where am I going with this post? How should we name these things? What makes sense?
In the Nintex world, we have Nintex variables, JavaScript variables, form controls, list and site columns and workflow constants. You can name these however you want. You can even give each one the same name but you’ll be asking for trouble!
Some may recall this mission where we had to fix a workflow. One of the issues with the workflow was a list column had the same name as a variable and there is no way to differentiate between the two when you’re looking at your workflow or form. If you do the same, you’ll make your workflows and forms harder to maintain and probably introduce a few more bugs than usual.
I’d suggest there is no single correct answer to how you should name things other than identifying/naming each of the aforementioned elements differently using a convention that works for you. Here’s how I do it:
Element | Description | Example |
---|---|---|
List and site columns | Plain English with spaces. I don’t have a convention about proper case or mixed case. Whatever seems appropriate. | Person Name |
Variables | Prefixed with the notation var and I don’t use spaces. | varPersonName |
Workflow constants | In all caps with words separated by an underscore. I don’t differentiate between constant types (site collection, site, data types etc) or should I? | PERSON_NAME |
Form controls | Accept the Nintex default which is to take the column name and remove spaces. | Personname |
I’m very interested to hear what naming conventions work for you. Do you use lowerCamelCase? Do you use Hungarian notation/include the data type in the name? Do you override the Nintex Forms default? Do you use spaces in your column names? Do you differentiate your constant types? Let us know in the comments below.
Cheers,
Chris
* Names bear no resemblance to popular members of this community. Whatsoever. Honest!