News for hackers. Stuff that matters.
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.