125

Because you might not want error messages in your output. According to computer scientist Stephen C. Johnson: One of the most amusing and unexpected consequences of phototypesetting was the Unix standard error file (!). After phototypesetting, you had to take a long wide strip of paper and feed it carefully into a smelly, icky machine which ...


110

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. UPPER ...


108

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 ...


93

You are thinking that all output is for human reading. For instance, take the Unix cpio command. It writes the archive to stdout, which is always redirected to a device or file. It writes the archive with a header before each file that contains the size of the file, which lets it calculate the offset to the next file when reading it back. If there was an ...


84

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. ...


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 ...


69

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 ...


66

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 ...


59

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

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 ...


48

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 ...


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 ...


41

Word size is not really an issue in implementing C on a given architecture. There's no requirement that C types have a power-of-two size. There's only a problem if the word size is too small, but this can be simply worked around by using multiple consecutive words to represent C types like int and long. There's a long list of C compiler implementations for 8-...


40

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 ...


36

The method depends on whether you have the address space or not, regardless of the RAM limitation. If you already have a 32-bit address space, but simply not much RAM, then the answer is virtual memory.  Virtual memory is generally processor supported: the processor traps accesses to memory that isn't present, and allows the operating system to perform ...


35

Machine language (and Assembly language) don't have the concept of data types, so if you want to add an int and a float variable in Assembly, you have to use the appropriate Assembly instruction that adds an int and a float. Erm... this sounds as if you're mixing up the idea of data types and operations on these. Data types are memory structures. Operations ...


34

I'm just speculating here, but one possible reason for using a 2-byte NOP would be if you wanted to change an existing 2-byte instruction into a NOP (to fix a bug, for instance), without changing the byte count for the instruction. (An undocumented 2-byte NOP might execute more quickly than two standard 1-byte NOPs in succession.) You might do this to ...


33

Objective-C was by all accounts a nightmare to work with I loved it. Loved it. Some background: in the 90s I worked for a developer here in Toronto with a Mac and Win app. I wanted to work on the dev side but I had no formal training, and I found the barrier to entry to be too high for my interest level. To do anything useful, you had to learn the OS, the ...


32

There are multiple reasons. First, there was no standards body publishing an official definition of the BASIC language (initially the closest thing to a standard was the Dartmouth version for mainframe computers, eventually the 'de-facto' standard became Microsoft's version simply due to market share). This left people free to fill in perceived gaps in the ...


31

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 ...


31

ENIAC was programmed by physically wiring the "program" on a plugboard: (picture from Wikipedia: https://upload.wikimedia.org/wikipedia/commons/7/7e/Eniac_Aberdeen.jpg) And since the question is not limited to digital computing, analog(ue) computers were often purpose-built; there is probably nothing more rudimentary than directly building your machine to ...


30

A mistake? The instruction $89 on the 6502 is a two-byte NOP. Based on adjacent instructions in the opcode matrix, especially LDA #ii ($A9 ii), it would have been STA #ii, a store to an immediate value, which makes no sense. On the 65C02, this instruction is changed to BIT #ii, which almost behaves as a two-byte NOP. One hypothesis is that a programmer ...


29

In UNIX, which was developed along with C, it is common to redirect the output of a command to a file or another program. For example, ls -a | more or ls -lr > index. In these cases, you would not want error messages appearing in your list of files, and especially not if the output of one command is being used as an input to another, and inserting an ...


28

Managing memory on an Apple II using Applesoft BASIC can be quite complicated, especially for large programs. A general map of Apple II memory at power-up looks like this: $E000-FFFF - Monitor ROM / Extended RAM 8 / 8 kB $D000-DFFF - BASIC ROM / RAM bank 1 & 2 4 / 4 / 4 kB $C800-CFFF - Shared slot ROM memory 2 kB $C100-C7FF - Permanent ...


27

The requirement that argv[argc] be null was added in the first version of 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 ...


26

The basic answer is “yes”, assuming you want to be a good DOS citizen, however in many cases you don’t need to worry about it because the operating system takes care of it for you. If you’re talking about conventional memory, allocating it explicitly isn’t necessary: EXE files’ headers specify the minimum and maximum amount of memory the program needs, and ...


26

I think it’s worth looking at the rise of Turbo Pascal (in particular) to understand its “downfall”. When Turbo Pascal was released, it has a number of advantages over the competition, regardless of programming language: it was fast, it produced (reasonably) fast programs, it came with excellent documentation, it included a full development environment with ...


26

Early on, you had to explicitly code your game for each graphics card you wanted to support: Hercules, CGA, Tandy, EGA, VGA. You had to know how to put the card into graphics mode and you had to know the memory layout, palette, and so on. You had to figure out how to avoid flicker and how to prevent tearing. You had to write your own line drawing and fill ...


26

man 7 ascii of Linux Programmer's Manual says, Uppercase and lowercase characters differ by just one bit and the ASCII character 2 differs from the double quote by just one bit, too. That made it much easier to encode characters mechanically or with a non microcontroller-based electronic keyboard and that pairing was found on old teletypes. As ...


24

Swift was introduced only in mid-2014 so I think perhaps some of those people's beards have greyed out very rapidly! That aside, Objective-C attempts to fuse two different languages: Smalltalk and C. So it's a compiled language, like C, that for object types also supports dynamic dispatch and introspection, like Smalltalk. It's actually a strict superset of ...


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