I’ve just updated aTbRef with recently emerging information on the workings of action code functions. That article and all its child notes should be read as a whole. As there isn’t a neat linear way to write the whole as a single article (plus it make fine referencing harder) it is split into a series of small notes.
As I’ve had some push-back on my aTbRef method of naming things, I would simply repeat the assertion that the stylised naming is there to help the learner, not the export. Those who already know where it is practical to use their own naming are free to do so.
Functions are a new and still evolving area and things may change. For instance, it is now clear that arguments (inputs) passed to a function arrive as strings—regardless of the type passed into the function. String, List and Dictionary types are fine but other may need passing into a suitably date-typed attribute or variable before further using the function. Of course if typed arguments become supported, all this guidance will be updated. But, it’s as correct as I can make it now.
This section on functions is a significant new addition to the aTbRef and I’d welcome feedback as to whether it does the job. Before replying a couple of provisos:
- This is written for the learner, not the expert programmer: the latter already know where it is safe to act differently - the naming of things being the most obvious.
- Please read the section (container note and 12 short child notes) as a whole before rushing to comment as the issue may be referred to in a note not yet read.
An aspect of understanding that was apparent as not being clear—from last weekend’s meet-up) is the naming of function arguments and loop variables. In both cases the user gets to name something that is then treated as if an attribute. Understanding is obvious after the fact, but I’m still looking for a different metaphor (maybe more than one is needed) to address this issue. A brief example, in the function context for a learner:
“The function is defined as
fSomeFunction(aList){...
but I need to pass it $MyList. How do I turnMyList
intoaList
? It’s not explained?”. The answer is obvious if you know. Very hard to guess otherwise.
I’m open to ideas on the latter—preferably ones that don’t that require the reader to have (assumed) programming knowledge!