News for hackers. Stuff that matters.
Re:AT&T Syntax versus Intel Syntax by monocasa on Sunday November 13, 2022 @03:19PM (#33586907)
...math has no such order. Half the point of algebra is that the two sides of the equation are semantically equivalent and can be swapped at will.
Re:AT&T Syntax versus Intel Syntax by pjmlp on Sunday November 13, 2022 @03:58PM (#33587264)
Good luck convincing anyone that value = variable makes sense.
Re:AT&T Syntax versus Intel Syntax by monocasa on Sunday November 13, 2022 @04:34PM (#33587580)
My math teachers had no problem with '42 = x' vs 'x = 42' as long as the steps made sense to get there. In fact they'd probably comment that there was no need to go with 'x = 42' if I obviously took a circuitous route simply to end up with x on the left side of the equation, as that would have demonstrated a lack of internalizing some of the base ideas of algebra and it's approach of equation symmetry.
Re:AT&T Syntax versus Intel Syntax by LudwigNagasena on Sunday November 13, 2022 @10:03PM (#33589802)
You should distinguish the meaning of = in mathematical and meta-mathematical statements. “42y = yx, therefore 42 = x” is fine; but “let 42 = x” is not.
Re:AT&T Syntax versus Intel Syntax by fweimer on Sunday November 13, 2022 @05:07PM (#33587882)
Some older C coding styles recommend that order because before compilers added warnings, “if (17 = variable)” resulted in a diagnostic, while “if (variable = 17)” would not. Nowadays, I think most programmers prefer putting the fastest-changing expression first.
Re:AT&T Syntax versus Intel Syntax by pjmlp on Monday November 14, 2022 @01:43AM (#33590871)
Yeah that is due to clever C semantics that that should never had allowed for anything other than boolean expressions in conditionals like proper grown languages.
Re:AT&T Syntax versus Intel Syntax by akira2501 on Sunday November 13, 2022 @04:20PM (#33587452)
And it has no state. Half the point of computation is maintaining state for the purpose of efficiency. So, computation gets an "assignment" operator where pure math lacks one, pure math being relegated to subscripts of time and indicator functions instead.