Questions tagged [history]
For questions relating to past design decisions in programming language design.
28 questions
18
votes
2
answers
4k
views
What is the origin of ++ and --?
In a lot of languages (eg Java, C++, etc), you can use ++ and -- as increment/decrement operators.
What was the origin of ...
4
votes
0
answers
112
views
What was the complete list of overstrikes supported by Multics APL?
APL famously has a lot of "characters" that are really two other characters overstruck. I was surprised to read in this Multics APL manual from 1985 that this extended even to overstriking <...
9
votes
1
answer
381
views
What is the problem with bidirectional views?
In his original paper on Views for Pattern Matching, Philip Wadler describes them as bidirectional: the definition of a view had both in and ...
6
votes
1
answer
2k
views
Why does the `target` attribute in HTML require a string starting with an underscore, such as `"_blank"`? Why not simply `"blank"`?
To specify in HTML that an <a> link needs to opened in a new tab or a new window, you use the following syntax:
...
26
votes
3
answers
7k
views
Why do many programming languages use the symbol of two vertical parallel lines `||` to mean "or"?
Why do many programming languages use the symbol of two vertical parallel lines || to mean "or"? Is it because two switches connected in parallel form a ...
19
votes
4
answers
3k
views
What's the justification for implicitly casting arrays to pointers (in the C language family)?
C has the behaviour of doing an implicit reference to element 0 of an array whenever you attempt to use it directly. This extends to passing arrays to/from functions - they get passed by pointer and ...
11
votes
1
answer
595
views
Why was && chosen as rvalue reference in C++?
I am NOT asking what && means.
Does anyone know the history of why the symbol && was chosen? I can give some ...
29
votes
5
answers
4k
views
Rationale for requiring struct prefix in C
In C, if you declare a struct like:
struct point {
int x, y;
};
you also have to use ...
9
votes
2
answers
1k
views
What's the rationale behind switch/yield in Java?
After upgrading to Java 21, I realized that the promised switch expression has several surprising properties. The most surprising part is the yield keyword which ...
9
votes
1
answer
2k
views
Why did std::set not have a contains function until C++20?
Another design decision that baffled me. Checking if an element is in a set is the entire purpose of a set! Until C++20 I had to write stuff like ...
16
votes
3
answers
5k
views
Why did C++ standard library name the containers map and unordered_map instead of map and ordered_map?
This is something that has slightly annoyed me for a while. A map as a mathematical object (function) is by default "unordered", and the same is for maps as a data structure AKA associative ...
7
votes
0
answers
342
views
What is the history of using dependent types to avoid array bound checks
Context
For memory safe languages to be fast, array bounds should be checked during compilation. Some language like Java, Rust, Swift, and others eliminate array bounds checks when possible, but the ...
6
votes
0
answers
324
views
What was the first language to use backslashes as escape characters in string literals?
I assume that C didn't originate the idea that, for example, the sequence \t inside a string literal should mean a tab character, that ...
12
votes
1
answer
409
views
What prevented fopen() from utilizing macros/flags but not fseek()?
In C, fopen() uses string literals such as "r" or "r+" or ...
44
votes
9
answers
9k
views
Why do (or don't) languages forbid unreachable code?
In Java, the following is a compile-time error, due to the unreachable statement:
while(true) {
break;
System.out.println("unreachable");
}
In ...