# New to .fp12 / FMP20

**URL:** <https://the.fmsoup.org/t/new-to-fp12-fmp20/3875>\
**Category:** Questions\
**Tags:** community\
**Created:** [January 2, 2024, 10:20am UTC](https://the.fmsoup.org/t/new-to-fp12-fmp20/3875 "2024-01-02T10:20:00Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![Kirk](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/kirk/32/2197_2.png) [@Kirk](https://the.fmsoup.org/u/Kirk)\
**Post date:** [January 11, 2024, 5:24pm UTC](https://the.fmsoup.org/t/new-to-fp12-fmp20/3875/21 "2024-01-11T17:24:55Z")

</div>

> [@Malcolm](#):
>
> they improved the function to allow many substitutions a single call.

Not sure that chained/nested command structures are an improvement. Most of my code can be written far more concisely, compact, and condensed, using nested commands, but 100% of the time, I will err on verbosity, resulting in readability / maintainability / "debugability", over short. I'd rather repeat commands multiple times than to nest a command structure.

![IMG_8919](https://canada1.discourse-cdn.com/flex030/uploads/fmsoup/original/2X/5/5e4f884398cf15558a9089c2d9f8eaa3b5546dfd.jpeg)

---

<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:** [January 11, 2024, 11:58pm UTC](https://the.fmsoup.org/t/new-to-fp12-fmp20/3875/22 "2024-01-11T23:58:42Z")

</div>

Those arguments might sway me in other situations but they aren't convincing me here. Especially as it's a core function and any improvements to it's performance and behaviour will flow straight into plain-vanilla usage. Nesting the function when it allows for an optional number of parameters might kindly be described as eccentric. 😉

```auto
Substitute ( 
  tbl::fld 
; ["&" ; "&amp;"]
; ["<" ; "&lt;"]
; [">" ; "&gt;"] 
)

```

```auto
Substitute ( Substitute ( Substitute ( tbl::fld ; "&" ; "&amp;" ) ; "<" ; "&lt;" ) ; ">" ; "&gt;" )

```

---

<div class="post-metadata">

**Author:** ![Kirk](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/kirk/32/2197_2.png) [@Kirk](https://the.fmsoup.org/u/Kirk)\
**Post date:** [January 12, 2024, 12:23am UTC](https://the.fmsoup.org/t/new-to-fp12-fmp20/3875/23 "2024-01-12T00:23:38Z")

</div>

> [@Malcolm](#):
>
> Those arguments might sway me in other situations but they aren't convincing me here

In this case, I agree with you. The "case" type structure of Substitute lends itself well to repeated arguments; IMHIO, it is more the aspect of nested commands that lends itself to verbosity and resultant maintainability over a minor tradeoff in performance

---

<div class="post-metadata">

**Author:** ![traut](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@traut](https://the.fmsoup.org/u/traut)\
**Post date:** [January 12, 2024, 6:27am UTC](https://the.fmsoup.org/t/new-to-fp12-fmp20/3875/24 "2024-01-12T06:27:36Z")

</div>

It's not very fair to show calculations that way and it is a weired concept of adding semicolons, but the last one, in front of the expression pair

```auto
Substitute ( Substitute ( Substitute ( 
  tbl::fld ; 
  "&" ; "&amp;" ) ; 
  "<" ; "&lt;" ) ;
  ">" ; "&gt;" )

```

does not look that much worse - and I doubt that there is a major performance tradeoff since in both cases the commands are done in sequence. It might be easy to run a test for comparison.

What I actually hate is the nesting [], which are not required e.g. for a case statement.

I guess that you have this substitution command within a custom formula already?

[Previous page](https://the.fmsoup.org/t/new-to-fp12-fmp20/3875.md?page=1)
