Strong PHP vibes. They also went for weird syntaxes that don't exist or rarely exist in other languages to simplify the parser.
It's 2023. How is parsing anything is a problem?
Strong PHP vibes. They also went for weird syntaxes that don't exist or rarely exist in other languages to simplify the parser.
It's 2023. How is parsing anything is a problem?
a, b = w < x, y > (z)
Is that "a, b = w[x, y](z)" (call function w of with type parameters x and y against z), or is it "a = w < x; b = w > (z)" (assign true to a if w is less than x, ...).With type information, this is possible to disambiguate, but the goal of the parser is to not require type information. Remember, now if you want correct syntax highlighting your editor has to have the type information, but you haven't typed that in yet!
As always, I think they made the right choice here.
Why?
It looks like a pretense at purity for the sake of purity.
If one of Go's aims was to make different trade-offs than [C++][1] did, then the choice not to use "<" as a grouping operator was a good one.
EDIT: Apologies, after a bit I realized the above is a bad comment.
Separation of concerns is a common pattern in programming. It allows for things to be testable and changes to be more localized. This is an example of that.
if you go (ah!) far enough on the other direction, you end up with 'template typename' soup.
Allowing ambiguity isn't just a style decision, it pushes error detection later, where you have enough info that it's no longer ambiguous.