On Sunday, 24 October 2021 at 21:26:25 UTC, Ola Fosheim Grøstad wrote:
On Sunday, 24 October 2021 at 20:46:01 UTC, claptrap wrote:
If you're writing a ton of boolean expressions over and over using a symbol instead of a word to express a concept will make it easier. It may increase the learning curve for people coming to it fresh, but that doesn't mean that is reason for doing it.
The only reason for doing it is that C used it. If there is any difference in typing speed then it would favour letters over symbols.
I'm saying it probably initially came from boolean algebra in maths. Or maybe even electronics, there was a history of boolean logic being expressed with symbols before programming languages even existed.
So that's the root. So then you have bitwise operations with symbols because math. Then you need to differentiate between bitwise and boolean logic so && and || makes more sense than using keywords. It's consistent with the already existing bitwise ops.
So you find them slightly faster to read, and anyone who doesn't use them must be showing off?
No, I made rational argument for why there are no advantages to using "&&" and "||" over "and" and "or". It is entirely cultural.
But they are not part of control flow, they are part of expressions.
Yes, 99% of them in conditional expressions as selectors in control flow. Why being pedantic?
if (num % 3)
if (ptr == null)
Are arithmetic and pointers now control flow? And anything you can put in the brackets after an if or while now becomes control flow?
It's not pedantic to call that argument nonsense.
Yeah cause programmers go around showing their code to non coders to try and impress them.
No, you don't get the main point. Culture and identity affects preferences and evolution of language, that is a human trait. It is pretty pervasive and well established. There is no reason to assume that programmers are different from other human beings.
Programming languages and natural languages have vastly different evolution. People are not subtly changing programming language syntax all the time as a means of self expression. It's designed once and then (for obvious reasons) pretty much stuck that way for ever at least within a given language. And then there's a kind of inertia across languages I think because familiar syntax is seen as a benefit for a new language.
I mean how long have && and || been in use? 50 years? That's not evolution and it's not fashion.
When someone designs a new programming language I dont think they are asking themselves how can I design the syntax to make themselves look cool, they are either choosing syntax because it is what they are used to, or for some other technical reason.
That's the issue I have with what you're saying, I dont think language designers are making syntax choices in order to look cool. In order to suggest that i think you have to have a fundamental misunderstanding of what motivates people to design their own programming language.