A language where whitespace is syntactically significant, used in HTML tags?
<% if condition: %><% action1 %><% action2 %>
How do I know whether action2 is also part of the if block or not; and how do I write the other version?
However, it should be noted that the PHP nature of mixing logic and templates is (mostly) an antipattern.
Yes, but beginners want it, because it has the smallest overhead for trivial projects. Later, when they learn more, they can separate the logic and templates. Here is a code that leads to antipatterns, but is nice to have—if you fix it, it will look much more difficult.
I’ve never used psp, but the documentation page seems to indicate what happens with indentation. It looks like it would be parsed as:
<p>
if condition:
....<b>
action1
</b>
action2
</p>
I have no idea how to get either “proper” behaviour, and I’m not in a position to experiment, but I’m sure it’s possible (that would be a fairly large omission).
Yes, but beginners want it, because it has the smallest overhead for trivial projects. Later, when they learn more, they can separate the logic and templates.
Yes, I agree that it is good for beginners; I was merely mentioning that point.
A language where whitespace is syntactically significant, used in HTML tags?
How do I know whether action2 is also part of the if block or not; and how do I write the other version?
Yes, but beginners want it, because it has the smallest overhead for trivial projects. Later, when they learn more, they can separate the logic and templates. Here is a code that leads to antipatterns, but is nice to have—if you fix it, it will look much more difficult.
I’ve never used psp, but the documentation page seems to indicate what happens with indentation. It looks like it would be parsed as:
I have no idea how to get either “proper” behaviour, and I’m not in a position to experiment, but I’m sure it’s possible (that would be a fairly large omission).
Yes, I agree that it is good for beginners; I was merely mentioning that point.