• 0x4E4F@lemmy.fmhy.ml
    link
    fedilink
    English
    arrow-up
    4
    arrow-down
    1
    ·
    edit-2
    1 year ago

    always use parentheses to denote order, there are no implied parentheses

    I completely agree on this, and yes, this is what I always do, cuz… well, we’re human, we make mistakes, parentheses makes things easily visible, thus cutting down on mistakes.

    Still, I do know operation order, as a rule I mean. In simple calcs like these, making a mistake is almost impossible. Thus, people that answered 16 probably just don’t know the order… that is something you learn in 1st, 2nd grade, it’s not quantum mechanics we’re talking about here.

    lazy mfs from centuries ago who were mortified by the thought of having to write ( and ) too much (lord what i wouldn’t give to hop in a time machine and show them lisp) should not be dictating our mathematical notation in this century.

    We only do that cuz we’re not sure how the compiler will interpret the operation order, and there’s waaaay too many versions and different languages to actually remember how each of them interprets math operation order. So, we do a safe bet, put parentheses on everything. Hell, I do it as well, I just can’t be bothered to remember if C interprets it like this, Python like that, Rust like… god knows what. They should, in theory, know math operation order, but let’s face it, we all do it cuz we’ve been faced with bugs that are a direct result of the compiler not intepreting things as it should.

    That being said, yes, I do agree that prentheses on everything, even math on paper, is the way to go. Plus, even people that don’t know operation order, will learn it a lot qucker if you just show them how easy things become once you start using prentheses.