Email or username:

Password:

Forgot your password?
Top-level
Jon (Snarf) Mason

@mattly @technomancy I agree with the principal. But I honestly don't know which way is better.

There are established conventions for the math operators yes. But those aren't the only binary operators in most programming languages.

What the fuck does order X + Y & Z apply in? (PS: fuck Ruby and whoever else though &&/and have different binding priorities was a good idea).

Once you move past the rules we learned for arithmetic, "go left to right for everything" actually is better, I think.

6 comments
Jon (Snarf) Mason

@mattly @technomancy I agree with you about trying to design languages to make it harder to make mistakes though and that's why I like the Pony approach.

I'm honestly not sure any way of assigning precedence of binary operators is good.

Matthew Lyon

@snarfmason @technomancy which brings us back to lisp, where you just nest the expressions! :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D :D

Matthew Lyon

@snarfmason @technomancy no I know, I mean, there’s not *really* a right answer there, but if there’s anything I’ve learned in over a decade of figuring out how to mistake-proof semantics, is that it’s better to fail / throw errors / prevent obviously stupid things from happening (the way pony does) than to ship obvious footguns

Matthew Lyon

@snarfmason @technomancy I once had to build alternate number types into a schema to represent statistical averages to prevent people from adding them, because people were taking multiple averaging results and averaging *those* & making decision based off this

people do stupid things like this all the time, yet we still have yet to really evolve our concept of numbers in computers to do things like making dividing by zero impossible by having dividend / divisor types

technomancy (turbonerd aspect)

@snarfmason @mattly yeah, I think you have to consider differently what's "better" in isolation vs better in context

if everyone switched to L->R consistently one day by magic: great; wonderful

if you have the one language trying to do it right in a sea of wrongness: maybe it's better to trade a few extra characters for increased clarity

even with something like smalltalk you're bound to have programmers whose job involves 95% javascript and 5% smalltalk; they would definitely rather have a syntax error than an incorrect result when they forget for a minute which language they're using

@snarfmason @mattly yeah, I think you have to consider differently what's "better" in isolation vs better in context

if everyone switched to L->R consistently one day by magic: great; wonderful

if you have the one language trying to do it right in a sea of wrongness: maybe it's better to trade a few extra characters for increased clarity

Go Up