Skip to content
Kuovonne's Guide to Scripting in Airtable
  • Pages
    • Kuovonne's Guide to Scripting in Airtable
      • So you want to learn Scripting?
        • Do you just want working code?
        • Can AI write my script?
        • Where do I start?
        • Kuovonne's coding journey (part 1)
      • Free Scripts
        • Formatted Timestamp
        • Interface Sidesheet Url
        • 2nd & 4th Monday of each Month
        • Copy value from one field to another
      • Examples of designing coding solutions
        • Tossed Salad Junction Records
      • Object IDs in Airtable
      • Automation Scripts
        • Converting a script to run as an automation
        • Automation script limits
      • Developing Generic Coding Skills
        • Traits of Quality Code
        • Reading Documentation
        • Using Variables
        • Debugging & Testing
        • Not Time Wastes
        • Comments in Code
      • Possible future topics
        • Future topics
          • Stylistic techniques
            • Using Functions

Using Functions


Guard clauses
Functions
Organize code in functions
Use guard clauses
Return values up front (guard clauses) or at the end of the function, not the middle.
The purpose of functions is to make code easier to read and maintain, not just to avoid repetition.
Avoid side effects

Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.