Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
  • How to structure functions and modules - before we cover the details of Lua, we are just looking at function structure and how to organize a Translator

  • Each component can be broken down into three parts that form a pyramid

    • Top: snowflake

      • These are the specific mappings and transformations

    • Middle: processes

      • Functions that do things

    • Bottom: systems

      • Interacting with external entities

  • Next point is how to organically write code so that it follows this three part pyramid structure

  • These are the three most important things to keep in mind when developing Lua code, and if you follow these, you will almost automatically follow our best practices for how component Translators should be structured (this is from IUC 2023 presentation on Interface Design)

    • Naming convention

      • Describe what the function does

      • Include interacting system

    • Configuration management

      • Avoid hardcoding

        • Custom fields and environment variables

      • Centralize configurations

    • Error handling

      • Log each breakpoint

      • Capture errors at breakpoints

  • Local vs. using a library

    • Referencing the below diagram, anything on the far right is a good candidate to be a library

...