Click here to Skip to main content
15,894,410 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Microsoft calculator - new math rules? Pin
OriginalGriff28-Jun-19 4:18
mveOriginalGriff28-Jun-19 4:18 
GeneralRe: Microsoft calculator - new math rules? Pin
DerekT-P28-Jun-19 4:33
professionalDerekT-P28-Jun-19 4:33 
GeneralRe: Microsoft calculator - new math rules? Pin
OriginalGriff28-Jun-19 4:48
mveOriginalGriff28-Jun-19 4:48 
GeneralRe: Microsoft calculator - new math rules? Pin
miki-bgd28-Jun-19 5:46
miki-bgd28-Jun-19 5:46 
GeneralRe: Microsoft calculator - new math rules? Pin
DerekT-P28-Jun-19 10:02
professionalDerekT-P28-Jun-19 10:02 
GeneralRe: Microsoft calculator - new math rules? Pin
Nelek28-Jun-19 11:04
protectorNelek28-Jun-19 11:04 
GeneralRe: Microsoft calculator - new math rules? Pin
kmoorevs28-Jun-19 5:03
kmoorevs28-Jun-19 5:03 
GeneralRe: Microsoft calculator - new math rules? Pin
kalberts28-Jun-19 5:06
kalberts28-Jun-19 5:06 
In APL, all operators have equal precedence. To a certain degree, I can understand the arguments for it.

For the very basic operators, it is easy to follow: Do multiplications before additions. But advanced programming languages (APL not the least) has so many operators for which there is no obvious or "natural" precendece. If you want to minimize the number of parentheses, you must have a list of operator precedence available at all times.

I guess that you can trust Visual Studio graying down "unneccessary" parentheses, and remove those. But when you read such minimal-parentheses code, you need that precedence list to see what is happening. You see lots of programmers adding "unneccessary" parentheses so that their C code looks halfway like Lisp Smile | :) , "just to be sure", and in a hardcopy output you have a terrible job finding the matching parenthesis. As a general rule: If your program code to any significant degree depends on operator precedence, or multiple levels of parentheses to override the defaults, then you need to break down your expressions into simpler sub-expressions. The compiler will anyway assign a memory location to hold the value of each subexpression, so you might as well do it yourself, and give a descriptive name to it!

In languages like APL there is one single rule: Left-to-right. Any parenthesis indicates a deviation from this rule: Watch out! So APL programs are never Lisp-like (well, that is one of the reasons Smile | :) ). I sort of like it. Even though I grew up with "multiplications before additions", I cannot off hand tell whether a logical XOR is done before or after a logical shift or an equality test. Which operators have higher precedence tahan preincrement but lower than postincrement? I don't know. I can't list those lower than preincrement, and can't tell just why bitwise negation goes before casting, while logical OR goes after. APL never gives you problems like this.
GeneralRe: Microsoft calculator - new math rules? Pin
miki-bgd28-Jun-19 7:11
miki-bgd28-Jun-19 7:11 
AnswerRe: Microsoft calculator - new math rules? Pin
lopatir28-Jun-19 5:30
lopatir28-Jun-19 5:30 
GeneralRe: Microsoft calculator - new math rules? Pin
MadMyche29-Jun-19 2:47
professionalMadMyche29-Jun-19 2:47 
GeneralRe: Microsoft calculator - new math rules? Pin
Eddy Vluggen29-Jun-19 6:42
professionalEddy Vluggen29-Jun-19 6:42 
GeneralRe: Microsoft calculator - new math rules? Pin
Dr.Walt Fair, PE30-Jun-19 4:23
professionalDr.Walt Fair, PE30-Jun-19 4:23 
GeneralLooking for a job Pin
GenJerDan28-Jun-19 1:27
GenJerDan28-Jun-19 1:27 
JokeRe: Looking for a job Pin
Peter_in_278028-Jun-19 2:11
professionalPeter_in_278028-Jun-19 2:11 
GeneralRe: Looking for a job Pin
CodeWraith28-Jun-19 2:19
CodeWraith28-Jun-19 2:19 
GeneralRe: Looking for a job Pin
glennPattonWork328-Jun-19 2:51
professionalglennPattonWork328-Jun-19 2:51 
GeneralRe: Looking for a job Pin
dan!sh 28-Jun-19 3:19
professional dan!sh 28-Jun-19 3:19 
GeneralRe: Looking for a job Pin
GenJerDan30-Jun-19 19:30
GenJerDan30-Jun-19 19:30 
GeneralRe: Looking for a job Pin
Mark_Wallace28-Jun-19 20:15
Mark_Wallace28-Jun-19 20:15 
GeneralRe: Looking for a job Pin
Dr.Walt Fair, PE29-Jun-19 7:27
professionalDr.Walt Fair, PE29-Jun-19 7:27 
GeneralRe: Looking for a job Pin
GenJerDan30-Jun-19 19:33
GenJerDan30-Jun-19 19:33 
GeneralCCC 28/6 - SOLVED Pin
PeejayAdams27-Jun-19 22:09
PeejayAdams27-Jun-19 22:09 
GeneralRe: CCC 28/6 Pin
OriginalGriff27-Jun-19 22:13
mveOriginalGriff27-Jun-19 22:13 
GeneralRe: CCC 28/6 Pin
musefan27-Jun-19 22:20
musefan27-Jun-19 22:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.