{% liquid %} vs multiple tags – best practice?

Is there any performance or best practice difference between using the {% liquid %} tag vs multiple separate Liquid tags?

For example, is there any reason to prefer:

{% liquid
  assign variable_a = 1
  assign variable_b = 2
  ...other logic
%}

over writing it like this:

{% assign variable_a = 1 %}
{% assign variable_b = 2 %}
{% ... %}

Curious if there’s a performance impact, readability advantage, or general best practice recommendation. Thanks in advance!

To my knowledege there’s no performance benefit, but most developers seem to prefer the liquid tag approach, I’m not a fan but I go with the majority.

1 Like