125
votes
Accepted
Why wasn't ASCII designed with a contiguous alphanumeric character order?
Why is ASCII this way?
First of all, there is no one best sorting order for everything. For example, should UPPER or lower case be first? Should numbers be before or after letters? Too many choices, ...
118
votes
Accepted
Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?
One use is as a copyright mechanism. Many distributors would steal/copy programs and sell pirate or derivative copies, by changing the text strings inside the code and reordering the blocks, it was ...
109
votes
Why was `!` chosen for negation?
Since the few document trails on this topic quickly run cold, I contacted Ken Thompson. He confirmed that if there was anything he would have been influenced by at the time, it would have been BCPL ...
90
votes
Accepted
Where did the popularity of the `i` variable come from?
FORTRAN made all variables starting with I, J, K, L, M and N integer by default. So just I by itself could be conveniently used as a loop variable. I imagine that choice was made because I, J, K, M ...
86
votes
Why didn't C++ specify filename extensions?
Because it's not important to ... anything.
The compilers don't care. The editors don't care. Back in the day, some operating systems didn't even HAVE "file extensions". DOS mandated them, ...
82
votes
Accepted
Who is credited for the creation of Assembly Language?
According to Wikipedia, the first assembly language, "Contracted Notation", was developed in 1947 by the late Kathleen Booth (née Britten). The language doesn’t look anything like “modern” ...
81
votes
Accepted
Did Forth's inventor Charles Moore really write a CAD program in only 5 lines of code?
tl;dr summary
tl;dr It's not 5 lines and it's not a CAD program, but it's still extremely small, but that's not as impossible as it first sounds.
What is meant by "CAD" program?
You are ...
77
votes
Accepted
How did old MS-DOS games utilize various graphic cards?
Did every programmer of every game implemented all possible various API's that old graphic cards supported?
Yes - but it went even deeper than that. Early graphics cards had virtually no callable ...
72
votes
When was this C function definition style, with type declarations of parameters after the parameter list, invented?
It's the original C syntax as designed by Dennis Ritchie, so bite your tongue :-)
As mentioned in another answer, the style was not unusual at the time. For an example of early art: FORTRAN II (1958) ...
71
votes
Why would a NES game use an undocumented 1-byte or 2-byte NOP in production?
The NES was also from the era where some sound and graphics resources were also executable code. (Typically, this worked the other way around. Identify a needed sound and listen to chunks of the ...
69
votes
Accepted
What happened to MODULA-2?
If you are asking whether Modula-2 as a programming language is still in use today, then I believe the answer is "Yes", although it was never a mainstream language. There are still active ...
65
votes
Why was nil defined as a reserved word in Pascal?
The definition of PASCAL is, above all else, intended to be simple. PASCAL was designed as a pedagogical language (with aspirations to be useful for commercial purposes, but that was a secondary ...
62
votes
Why wasn't ASCII designed with a contiguous alphanumeric character order?
According to ASA X3.4-1963 Appendix A, one of the design considerations was:
(7) Ease in the identification of classes of characters
Furthermore:
A4.4 The character set was structured to enable ...
59
votes
Accepted
What was the first programming language to support “operator chaining”?
COBOL
IF X IS GREATER THAN 0 AND LESS THAN 99 ...
58
votes
Accepted
How was collision detection done on the Asteroids arcade game?
it seems to be a simple bounding box check, as shown here from 6502 code disassembly, collision check between ship and saucer
HitDetShip:
L6A63: CPX #$01 ;Is object 1 not the player's ...
58
votes
What was the first Object Oriented programming language?
Simula 67
Simula has objects, classes, subclasses, and inheritance.
Dahl and Nygaard shared a Turing award for their pioneering work.
57
votes
Accepted
What is this programming language having PROC, DCL, LABEL keywords?
It's PL/I, promoted by IBM as the successor to FORTRAN, Algol 60, and COBOL.
That's actual code as far as I recall, not pseudocode.
PL/I had abbreviations for keywords; "DCL" is "DECLARE".
It starts ...
57
votes
Why was `!` chosen for negation?
The ! was around as part of the B programming language, according to the "User's Reference For B" (K Thompson, Jan 1972).
Somewhere between BCPL and B, the decision was made to use !.
In the ...
56
votes
Accepted
What was the first programming book
I would say one of the versions of the Menabrea paper, written in 1842 by Luigi F. Menabrea.
Ada Lovelace became involved in computing when she was asked to translate this paper from Italian to ...
55
votes
In what language(s) is the return value set by assigning to the function’s name?
Pascal does this, I don't know of others. Don't know if the practice move forward with other Wirth languages.
53
votes
In what language(s) is the return value set by assigning to the function’s name?
The languages in the Visual Basic family do exactly this. This includes VBScript, VBA, Visual Basic and earlier. I believe these inherit the "feature" from QBASIC. For example
Public ...
53
votes
Did type-in-programs or type-in-listings teach programming in the 70s and 80s or was it just tedious typing of the source code?
The typing didn't. The subsequent debugging did.
52
votes
Accepted
Why were single quotes ('…') chosen for characters, and double quotes ("…") for strings?
For type system reasons, and for compatibility with B.
B is a programming language that served as the immediate ancestor of C. The salient thing about B is that it had no type system: all values in B ...
49
votes
Accepted
Did anyone ever run out of stack space on the 6502?
Unlike its main rival the Z80, the 6502 had a size limit of 256 bytes for the hardware stack.
The 6502 stack is mainly meant as a return stack and for register preservation - which usually isn't a ...
48
votes
Accepted
What is 'Adaptive Tile Refresh' in the context of Commander Keen?
"Adaptive Tile Refresh" is the strategy of maintaining a software-drawn tilemap in memory in place by redrawing only the tiles which differ after moving a logical camera across a grid of ...
47
votes
Accepted
Why (historically) include the number of arguments (argc) as a parameter of main?
K&R first edition (1978) does not mention the NULL terminator in the argv list at all. This was added later, in ANSI C. The relevant paragraph (section 5.11, p. 110) is:
In environments that ...
45
votes
How did Elite do vertex transformation?
Like all games from that era, cheating and tables.
Two 256 byte tables and logarithms gave a 10x speed boost on multiply and divide on Commodore 64 at least.
Matrix operations using addition only for ...
45
votes
Why can't I invoke the next interrupt service by incrementing the AX register after calling the same interrupt?
When calling the mouse driver interrupt with AX = 0, it returns 0xFFFF in AX if a mouse driver is installed.
So if it is installed, the code with INC AX will increment AX back to 0 and then it will ...
45
votes
Why did the monsters have "infinite invisible pillars" of hitboxes vertically in all versions of the DOOM engine?
Doom maps and locations on the maps were essentially 2D. This makes a lot of stuff much cheaper to calculate that a general 3D solution but has some limitations: objects can't stack, you can't jump ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
programming × 246history × 70
ms-dos × 24
assembly × 24
c × 16
compilers × 16
commodore-64 × 15
graphics × 15
basic × 13
6502 × 11
gaming × 11
design-choices × 9
pascal × 9
apple-ii × 8
fortran × 8
software-development × 7
applesoft-basic × 7
amiga × 6
emulation × 6
apple-macintosh × 6
mainframe × 6
operating-system × 5
terminology × 5
debugging × 5
ibm-pc × 4