# FileMaker Custom Function naming conventions

**URL:** <https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713>\
**Category:** Floating Topics\
**Created:** [September 26, 2023, 4:37pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713 "2023-09-26T16:37:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tonywhitelive](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/tonywhitelive/32/208_2.png) [@tonywhitelive](https://the.fmsoup.org/u/tonywhitelive)\
**Post date:** [September 26, 2023, 4:37pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713/1 "2023-09-26T16:37:33Z")

</div>

I sometimes name FileMaker Custom Functions with a special character prefix so that when I see them in calculations there is a visual difference from:

- $vars
- $$vars
- ~ (Let Function variables)
- Table Occurrence Names
- Field Names
- Built in FileMaker Functions
- Plugin functions (which notably use prefixes as well)

As far as I know, FileMaker Custom Functions are not called by external technologies and therefore we can safely use characters in the name that we would want to avoid in, for example, Script Names, Field Names, etc.

Using a prefix also facilitates type ahead as a single keystroke separates Custom Functions from built in FileMaker Functions

I have been using the following 3 conventions:  
[1] #  
[2] @ // even though [Brian Dunning's free FileMaker Custom Functions library](https://www.briandunning.com/filemaker-custom-functions/) does not seem to like @ as a prefix (search for @escapeTextForFind\_v4 which will fail and then try [FileMaker Custom Function: @escapeTextForFind\_v4](https://www.briandunning.com/cf/2664))  
[3] lower case because built in FileMaker functions are upper case

I avoid \_ as a prefix because it is used so many other places that it does not visually stand out.

What other prefixes are people using?  
Seems like `, !, and % are allowed and on the keyboard.

Thoughts?

---

<div class="post-metadata">

**Author:** ![ByteTheBullet](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@ByteTheBullet](https://the.fmsoup.org/u/ByteTheBullet)\
**Post date:** [September 26, 2023, 4:52pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713/2 "2023-09-26T16:52:34Z")

</div>

I typically use # as a prefix. Seems to be easy to pick up visually, and it's not a character that is common in any calculations.

---

<div class="post-metadata">

**Author:** ![bdbd](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/bdbd/32/620_2.png) [@bdbd](https://the.fmsoup.org/u/bdbd)\
**Post date:** [September 26, 2023, 5:12pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713/3 "2023-09-26T17:12:07Z")

</div>

I use prefixes in my custom functioins to create a pseudo-namespace. This helps me better manage the many custom functions I use, both of my own creation and from external sources.

My naming strategy goes like this:

- Start with a two or three character code denoting the authorship (dc for D-Cogit);
- Add a grouping name (my error handling custom functions start with dcError);
- End with two underscore characters to separate the prefix from the function name.

Here is an example: `dcError __isError__ n`. As you can see, I use lower camelcase naming for the function name (one reason for the separator) and a suffix to denote the return type.

---

<div class="post-metadata">

**Author:** ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)\
**Post date:** [September 26, 2023, 6:48pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713/4 "2023-09-26T18:48:03Z")

</div>

> [@bdbd](#):
>
> dcError\_\_isError\_\_n

Ah the fabled camel snake!

---

<div class="post-metadata">

**Author:** ![Malcolm](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/malcolm/32/196_2.png) [@Malcolm](https://the.fmsoup.org/u/Malcolm)\
**Post date:** [September 26, 2023, 10:35pm UTC](https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713/5 "2023-09-26T22:35:38Z")

</div>

I have to admit that I'm very fond of the camel snake. I think of the snake separators as field separators.

---

<div class="post-metadata">

**Author:** ![HuConn](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/huconn/32/2329_2.png) [@HuConn](https://the.fmsoup.org/u/HuConn)\
**Post date:** [September 28, 2023, 9:25am UTC](https://the.fmsoup.org/t/filemaker-custom-function-naming-conventions/3713/6 "2023-09-28T09:25:42Z")

</div>

For my part i have two different syntaxes, one for functions I use very often and one for the rest. I am an old school, low level, software developer, so I have a minimalistic approach that I don't see in most others code examples. (Started with Assembler and Forth in the 1990's).

Anyhow, these screen dumps should be self explanatory, and the naming convention makes it very easy for me to remember. Something that is important for me, since may standard library currently contains 483 custom function.

With the name space approach I can easily spot them in my calculation, and with the "look ahead(?)" i just start typing "num." to see a list of all my functions concerning numerals. (I also use MBS plugin extensively, and love the Syntax colorization).

So first are the often used CF's, and then some random screen shots from the list.  
(The parameter "setup" is a map data structure that makes it easy for me to add more options to a them).

![Skärmavbild 2023-09-28 kl. 11.00.35](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/b/b0bd4f6ceaf8630ddd4a9f60e13f4f3db72aa4a0.png)

 ![Skärmavbild 2023-09-28 kl. 11.04.51](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/f/f804396f6417a4b3979bc998383d0dbbe92b356d.png)

 ![Skärmavbild 2023-09-28 kl. 11.05.19](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/7/72657bf16d9e7a29e7a7244fcbaea786e1859805.png)
