Feedback requested: Preferred format for Pack Studio slash-command snippets

Hi Pack Makers - In the Pack Studio there are slash commands you can use to inject snippets of code. These snippets make it easier to write Packs by reducing the amount of boilerplate code you need to remember or type.

Currently those snippets look like this:

pack.addFormula({
  name: "<User-visible name of formula>",
  description: "<Help text for the formula>",
  parameters: [
    coda.makeParameter({
      type: coda.ParameterType.String,
      name: "<User-visible name of parameter>",
      description: "<Help text for the parameter>",
    }),
    // Add more parameters here and in the array below.
  ],
  resultType: coda.ValueType.String,
  execute: async function ([param], context) {
    return "Hello " + param;
  },
});

Notably, they use placeholders like <User-visible name of the formula> to indicate what parts of the snippet to replace and what to put there.

I’ve been considering switching it to an alternative format though, more like this:

pack.addFormula({
  name: "MyFormula",
  description: "My description.",
  parameters: [
    coda.makeParameter({
      type: coda.ParameterType.String,
      name: "myParameter",
      description: "My parameter description.",
    }),
    // Add more parameters here and in the array below.
  ],
  resultType: coda.ValueType.String,
  execute: async function ([param], context) {
    return "Hello " + param;
  },
});

Notably, replacing the placeholders with dummy values. While you lose some context the placeholders provide, you also gain some insight into the format of each value (upper camelcase for the formula name, etc).

Which do you prefer?

I am by no means an expert, so for what it is worth, I like a hybrid version:
“<myFormula>”
The <> make it stand out and easy to find, while the best practice format (upper or camelcase etc.) is clear, without to much clutter.

Edited: the “<myFormula>” didn’t show properly, but showed as “”

1 Like

I like the second one personally

1 Like

My sequence

  1. Joost’s suggestion - it can be difficult for newbies to find the areas that need to be personalised.
  2. New version.
  3. Old version.
1 Like