Question

Why do we use "&&" instead of "and" in so many languages? I get that it has sort of become the standard for programmers, but how did that originally happen?

Was it helpful?

Solution

It is up to the language designer to make these decisions, but one reason is that there is two types of and - regular and bitwise (&& vs &)

It's harder to succinctly express the bitwise version using English words

OTHER TIPS

Why did programming languages originally use “&&” instead of “and”?

You have it back to front. Originally they used and: Fortran, Cobol, Algol, Pascal, PL/1, all the varieties of Basic, ...

It was the BCPL series of languages (B, C, C++) that introduced & and && as far as I know, and Java and C# followed suit. You would have to ask the BCPL designers why, if they are still around.

APL used the set-theoretic symbols ^ and its inversion.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top