POWER APPS – FISSION DEV – Part 4

This image has an empty alt attribute; its file name is Fission-Dev.png

Level: Yellow (on scale of white, yellow, orange, …, black)

Very Basic Themes (Still getting there)

I really want to discuss ‘very basic themes’, but there are a couple of pre-requisites. Last time the concept of variables and collections wrt scope (global or local) and naming conventions was discussed.

This time is naming conventions for fields such as text boxes, labels etc.

Why is this important?

Well, I definitely have my own style here. I believe, if the app requires a field, then it should be offered the courtesy to name it. Why?

Year Test: In a year time you may need to upgrade the app. Chances are you don’t recall all details of the app. This naming may assist you. Yes – it is enforced documentation by convention.

New Maker test: Apps you are making will most probably be past onto a different person, as per normal business staff movement. Even though your employer may not appreciate it, the person taking over your app will. You can move to greener pastures with no baggage.

Global Nature of fields: This is critical, if the other reason do not touch your fancy. This is tangible, because it will save you hours of debugging.

Naming conventions
Start with a prefix such as: ‘lbl’ for labels, ‘txt. for textboxes
End off with a suffix to identity the screen such as ‘acc’ for account and ‘inv’ for invoice

Example
txtAccountName_acc is a textbox for account name on the account screen
lblAccountName_acc is the label for the above textbox on the account screen

comAccountName_inv is the combo box for account name of invoice screen
lblAccountName_inv is the label for the above combo box on the invoice screen

Now if on the invoice screen, I should be using ‘_inv’ postfix fields. If I find a reference to to ‘_acc’ on the invoice screen there is a 95% chance this is an error. Hence debugging has just got easier.

It Takes Times
Yes it does, but this is the trade-off that is required, to make your future easier.

Even labels?
I hear the sceptics say even labels, I don’t reference them anywhere.
Yes – by the way I do reference labels in my validations – by displaying the label value to a user when reporting an error.

Basic Themes
This will be deferred until next time as this blog is already long.

Pet Hate:
To finish off my pet hate regarding variables is two fold:

1) watching YouTube videos with badly named fields and no apology (warning) thereof. Newbies will watch videos and may wrongly get the perception that badly named fields are acceptable.
2) Some of Microsoft examples also have this badly name field weakness. Well done Microsoft for naming conventions on there sample wizard. I would ask Microsoft to consider including suffix to identify the screen (as above)