123

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, and no way to please everyone. So they came up with specific pieces that "made sense": Numerals 0x30–0x39 - Easy bit mask to get your integer value. ...


119

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 hard to prove the code had been stolen. Placing noops of different types you could put a signature sequence which was much easier to detect and hard to hide. A ...


101

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 and SMALGOL. But given that these don't use ! for negation, he "might have made it up". I don't suspect there is anything more to it that can be ...


89

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 and N are very commonly used as indices in mathematics. e.g., a sum of a series will typically be expressed as summing the terms A(i) for i going from 1 to n. ...


85

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, DEC system mandated them. Unix didn't. What's the standard extension for Fortran? For Pascal? For BASIC? Lots of convention, many system specific. But no ...


70

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 binary to find a reasonable candidate.) Injecting NOPs can improve the look or sound derived from a section of executable. Example: "One of the more-challenging ...


70

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); it’s more a mathematical representation of computer operations. The first mnemonic-based assembler was developed by Maurice Wilkes and David Wheeler for the ...


70

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 code associated with them at all, the concept of "drivers" had not quite become a reality yet. There was the concept of a Video BIOS, which were extensions to the ...


64

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 concern). For this purpose, the definition had to be small and orthogonal so that it could be explained simply and concisely. For ease of implementation, the ...


61

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 the easy identification of classes of graphics and controls. And on page 8: A6.3 To simplify the design of typewriter-like devices, it is desirable that ...


57

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 off by defining a procedure (routine) named P with one parameter, named MODE, which is a Boolean variable - BIT(1), then defines a bunch of 16-bit signed ...


57

COBOL IF X IS GREATER THAN 0 AND LESS THAN 99 ...


56

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 Reference above, I can't find an indication of why it was chosen. "The NOT prefix unary operator ! takes an integer value operand. The result is zero if ...


53

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 ship? L6A65: BCS HitDetSaucer ;If not, branch. L6A67: ADC #$1C ;Ship hit box 42+28 = 70 X 70 from center. HitDetSaucer: L6A69: BNE ...


52

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 French. She did so, and unlike many translators, was knowledgeable enough about the subject matter that rather than introducing errors into the translation, she ...


52

Pascal does this, I don't know of others. Don't know if the practice move forward with other Wirth languages.


51

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 Function AddTwo(something as Integer) AddTwo = something + 2 End Function


49

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 are machine words (corresponding to the C type int). In B, there were two ways to represent strings in source code: string literals0, which evaluated to a ...


46

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 fixed known rotation rates. Lazy evaluation. Only convex shapes making hidden line removal simpler and hidden line removal meaning only half the vertices ...


45

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 support C, there is a way to pass command-line arguments or parameters to a program when it begins executing. When main is called to begin execution, it is called ...


45

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 over them, you can shoot them by aiming over/under them and paths can't pass over/under other paths. But 99% of the time you don't notice any of this :o)


44

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 just reset the mouse driver a second time. It is very typical that interfaces that use software interrupts give you back a status code in AL or AX, so this is no ...


42

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 tagged for its "type" (even though not quite what we know from higher level languages). Probably the first widespread tagged architecture computer was the ...


42

"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 tile indices to scroll the screen, or are dirtied by an overdrawn sprite. Quotes from Carmack and Romero: Carmack: The trick behind the scrolling in the first ...


39

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$ are two different variables. This is not a bug but a feature. The type is needed to distinguish them. The BASIC language is defined to work that way. Changing ...


37

The Early Days As you said, the most important languages on the Mac in its early days were Microsoft's BASIC, Pascal, and, of course, 68000 assembly. The Macintosh's System Software and ROMs were themselves programmed largely in assembly, with a bit of Pascal thrown in (mostly for pieces that were ported directly from the Lisa). C was merely a niche language ...


37

The requirement that argv[argc] be NULL was added in the ANSI C standard; it wasn’t a requirement before then, and some environments didn’t null-terminate the array (the strings themselves were of course null-terminated). In fact, in Unix V4, argv[argc] was documented as being -1 and not 0. Thus before ANSI C, argc was necessary, and it was kept thereafter ...


37

The early Apple Macintosh computers (original Mac, Mac 512K, Mac Plus) all came with a "Programmer's Switch" installed on the side. Yes and no. While the switch was there, it was on the inside, so, not really accessible. Only after being 'enhanced' with the so called 'Programmers Key Aid', a snap on after market piece of plastic, griping into the ...


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