You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.
{% # (1) conditions first %}
{% ifa>bandc<dorcol!=emptyandcolcontainsstring
%}
{% # (2) conditions last %}
{% ifa>bandc<dorcol!=emptyandcolcontainsstring
%}
I'm definitely a conditional first kind of guy (usually), but I'm not sure that's great considering those don't align as well as || and &&...
In fact, just looking at the above, I think the second one looks better.
Moreover, thinking about the "evaluated right to left," that'd mean that you'd want to consider them "whatever is at the top" + "logical operator" + whatever is down below.
Which I think makes more sense with the second style.
{% ifa>bandc<dorcol!=emptyandcolcontainsstring
%}
if a > b AND
(
c < d OR
(
col != empty AND
col contains string
)
)
{% endif %}
Because then the "sub" conditions are little blocks that can be thought of line by line.
Partner slack and internal slack suggests we want conditions first. So it'll be conditions first.
need to decide (2)
What if the conditionals are really really long? e.g.
Decisions:
- We're going logical operators first
- We're maybe breaking on comparator (but grouped)
- Same syntax as others `{% if $condition1`, ..., `%}`
Partial fix of #62
Decisions:
- We're going logical operators first
- We're maybe breaking on comparator (but grouped)
- Same syntax as others `{% if $condition1`, ..., `%}`
Partial fix of #62
https://shopify.dev/api/liquid/tags#conditional-tags
https://shopify.dev/api/liquid/basics#operators
need to decide
I'm definitely a conditional first kind of guy (usually), but I'm not sure that's great considering those don't align as well as
||
and&&
...In fact, just looking at the above, I think the second one looks better.
Moreover, thinking about the "evaluated right to left," that'd mean that you'd want to consider them "whatever is at the top" + "logical operator" + whatever is down below.
Which I think makes more sense with the second style.
Because then the "sub" conditions are little blocks that can be thought of line by line.
Partner slack and internal slack suggests we want conditions first. So it'll be conditions first.
need to decide (2)
What if the conditionals are really really long? e.g.
I feel like indenting with operator first is the way to go. I think we can do this with groups. So I'll do it.
The text was updated successfully, but these errors were encountered: