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, ...
manassehkatz-Moving 2 Codidact's user avatar
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 ...
LOIS 16192's user avatar
  • 1,212
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 ...
Kaz's user avatar
  • 1,660
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 ...
George Phillips's user avatar
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, ...
Will Hartung's user avatar
  • 12.2k
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” ...
Stephen Kitt's user avatar
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 ...
Jörg W Mittag's user avatar
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 ...
Greg Hewgill's user avatar
  • 6,849
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) ...
another-dave's user avatar
  • 33.5k
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 ...
Eric Towers's user avatar
  • 1,119
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 ...
Jörg W Mittag's user avatar
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 ...
Jules's user avatar
  • 12.8k
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 ...
Greg Hewgill's user avatar
  • 6,849
59 votes
Accepted

What was the first programming language to support “operator chaining”?

COBOL IF X IS GREATER THAN 0 AND LESS THAN 99 ...
another-dave's user avatar
  • 33.5k
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 ...
Jean-François Fabre's user avatar
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.
another-dave's user avatar
  • 33.5k
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 ...
another-dave's user avatar
  • 33.5k
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 ...
Clinton Pierce's user avatar
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 ...
Jerry Coffin's user avatar
  • 4,742
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.
Will Hartung's user avatar
  • 12.2k
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 ...
Omar and Lorraine's user avatar
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.
Mark Morgan Lloyd's user avatar
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 ...
user3840170's user avatar
  • 21.6k
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 ...
Raffzahn's user avatar
  • 213k
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 ...
knol's user avatar
  • 11.8k
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 ...
Greg Hewgill's user avatar
  • 6,849
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 ...
Alan B's user avatar
  • 3,857
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 ...
Justme's user avatar
  • 28.3k
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 ...
Peter Ashford's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible