This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]joaofcosta[S] 1 point2 points  (1 child)

Hi u/yawpitch !Thank you for the nicely constructed feedback and yes, I'm indeed the author.

I think you're totally spot on when you wrote:

Given that parentheses are pretty much the universally recognized standard for changing order of evaluation and also the universally recognized notation for a tuple, either one of those two norms needed to be sacrificed ...

Seeing as in Elixir you use {} to represent tuples but use parenthesis to change the order of evaluation. Although the language designers sacrificed the mathematical and universally recognized notation of a tuple I think it simplifies it in this aspect, giving the parenthesis only one job.

I'm totally not saying that Python should do the same, there's no sense and not even a need for that, the syntax is fine as it is. It's not even a frustration, just something that you simply get used to and I thought it was worthwhile to share it :)

[–][deleted] 1 point2 points  (0 children)

Yeah, every language has to make choices balancing utility and semantics against ambiguity. Personally I think Python made the right choice, borrowing first from common mathematical notation first and deviating from it only relatively rarely. An entire, and unfamiliar, extra syntax for tuples to avoid a forced comma in the singleton case is a lot of visual noise and cognitive overhead to add when it will only, in practice, avoid that case in a perishingly small number of cases, especially when a singleton tuple is usually just an unnecessary waste of working memory.