What is BODMAS and why is it useful in programming?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
http://www.easymaths.com/What_on_earth_is_Bodmas.htm:
Why it is useful in programming? No idea, but i assume it’s because you can get rid of some brackets? I am a quite defensive programmer, so my lines can look like this:
with BODMAS you can make this a bit clearer:
I think i’d still use the first variant – more brackets, but that way i do not have to learn yet another rule and i run into less risk of forgetting it and causing those weird hard to debug errors?
Just guessing at that part though.
Mike Stone EDIT: Fixed math as Gaius points out