3 ms·
For me, the syntax is ok, however it doesn't always do what you expect. For example: if (some_condition) { x = 2; } x doesn't get set to 2.
by derekp7 7y ago
For me, the syntax is ok, however it doesn't always do what you expect. For example:
if (some_condition) {
x = 2;
}
x doesn't get set to 2. Or even better, this:
x = 2;
echo("x = ", x);
x = 5;
This prints out that x = 5.
- iamwil 7y agoIt should technically throw an error before compiling. You're thinking about it as an imperative language, when it aspires to be declarative.
- unlinked_dll 7y agoPersonally I think that's a bug, not a feature. If the language aspires to be declarative, but features imperative constructs, it should have a syntax that reflects the distinction. I work with these kinds of things a lot, having that clear divide between declarative and imperative operations on whatever being expressed isn't only easier to learn and read, it's far more expressive and powerful for complex systems.
- iamwil 7y agoYou misinterpret--or rather, I wasn't clear. While I say it aspires, I'm not saying it's a good choice. I'm just saying its odd behavior makes a lot more sense once you know it's meant to be declarative, and you can make a lot more headway when working with it.
- kevin_thibedeau 7y agoIt is not an imperative language even though it is dressed up like one. You are describing a data structure, not a sequence of operations.