124 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, ...
user avatar
119 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 ...
user avatar
  • 1,204
104 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 ...
user avatar
  • 1,562
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 ...
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, ...
user avatar
  • 10.9k
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 ...
user avatar
  • 1,099
71 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 ...
user avatar
  • 5,537
70 votes
Accepted

Who is credited for the creation of Assembly Language?

According to Wikipedia, the first assembly language was developed in 1947 by Kathleen Booth (née Britten). The language doesn’t look anything like “modern” assembly though (see the end of this paper); ...
user avatar
  • 95.7k
68 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 ...
user avatar
67 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) ...
user avatar
  • 27.8k
64 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 ...
user avatar
  • 12.3k
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 ...
user avatar
  • 5,537
59 votes
Accepted

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

COBOL IF X IS GREATER THAN 0 AND LESS THAN 99 ...
user avatar
  • 27.8k
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 ...
user avatar
  • 27.8k
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 ...
user avatar
57 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.
user avatar
  • 27.8k
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 ...
user avatar
  • 3,627
53 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 ...
user avatar
52 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.
user avatar
  • 10.9k
51 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 ...
user avatar
  • 34.3k
50 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 ...
user avatar
  • 16.6k
46 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 ...
user avatar
  • 5,537
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 ...
user avatar
  • 3,011
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 ...
user avatar
44 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 ...
user avatar
  • 17.2k
42 votes

Which was the first programming language that had data types?

The premise: Machine language (and Assembly language) don't have the concept of data types is not quite correct, because tagged architecture means exactly this, machine language where the data is ...
user avatar
42 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 ...
user avatar
  • 9,875
39 votes

Why do variable names in BASIC need type suffixes?

TL;DR: Most straight answer: Because it's BASIC A trailing '$'-sign is the syntax BASIC defined when adding strings. Also, the suffix is not only a type marker, but part of the name. In BASIC A and A$ ...
user avatar
  • 168k

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