If we use match instead of If, will it improve the performance

Certified Senior Developer

If we use match instead of If, will it improve the performance

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Well, I suppose we first need to define 'performance' here.

    An a!match consisting of 5 components in my view is performing better than the equivalent, more compex, if-statement in terms of maintainability.

    In terms of speed-performance, you can test both versions of some logic to see what performs better.

    In my view nested if should not exist anymore going forward; use a!match for this.

Reply
  • 0
    Certified Lead Developer

    Well, I suppose we first need to define 'performance' here.

    An a!match consisting of 5 components in my view is performing better than the equivalent, more compex, if-statement in terms of maintainability.

    In terms of speed-performance, you can test both versions of some logic to see what performs better.

    In my view nested if should not exist anymore going forward; use a!match for this.

Children