This might seem like a silly question, but I always wondered why square brackets were so easily accessible on an English QWERTY keyboard while the parenthesis is relatively cumbersome to reach. While square brackets are commonly used in many languages (e.g. indexing in C-style languages), they don't have nearly the prominence that parentheses do - pre-2000's Fortran doesn't have square brackets at all. One would think that the parenthesis would be a priority character to have available with as few keystrokes as possible. Am I mistaken in my assessment and it was/is thought to be a more convenient position than the square brackets are now in? I'm more used to the Swedish keyboard (with the dreaded Alt Gr key and everything) even though I think it is objectively less good than the standard QWERTY one for programming, so maybe I'm just wrong.
​
Layout I'm talking about: https://en.wikipedia.org/wiki/QWERTY#/media/File:KB_United_States.svg
The answer lies in the evolution of typewriter keyboards. The first commercially successfully typewriter was the Sholes and Glidden typewriter AKA the Remington No. 1. The designs by Sholes et al. had gone through various iterations before the machine they patented in 1868. One element that changed through these iterations was the keyboard layout, starting with a two row keyboard in numerical and alphabetical order:
|||||||||||||||||| -|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|-|:- 3 | 5 | 7 | 9 | N | O | P | Q | R | S | T | U | V | W | X | Y | Z 2 | 4 | 6 | 8 | . | A | B | C | D | E | F | G | H | I | J | K | L M
which changed to more rows and different ordering to reduce the likelihood of jams:
||||||||| -|-|-|-|-|-|-|-|-|- 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | - | , Q | W | E | . | T | Y | I | U | O | P Z | S | D | F | G | H | J | K | L | M A | X | & | C | V | B | N | ? | ; | R
No need for 1 and 0, since I and O could perform double-duty as both letters and numbers. The patent owners, who had bought the patent from the inventors partnered with firearms manufacturer Remington to make the typewriter. Remington took this almost-QWERTY keyboard and made the small modifications to turn it into QWERTY, and began manufacture in 1873. The Remington No. 2 typewriter, introduced in 1878, saw the advent of the shift key. The letter keys, combined with the shift key, allowed both upper and lower case letters to be typed (unlike the upper-case-only No. 1). Since case was irrelevant to numbers, the number keys (still 2 to 9) could be used for other characters, with the shift key, and punctuation-only keys could type two different characters. Being very successful commercially (compared to other typewriters at the time), the Remington No. 2 keyboard:
became the prototype for later typewriters.
Enter the next key evolutionary step towards the modern computer keyboard: the IBM Selectric typewriter. The original Selectric was first produced in 1961, followed by the Selectric II in 1971 and the Selectric III in 1980. The Selectric typewriters were electromechanical typewriters using typeballs ("elements" in IBM-speak). Typeballs offered two major advantages: they were free from the jams that conventional typewriter typebars were susceptible to, and they could be easily changed, allowing fonts and character sets to be changed:
Changeable typeballs allowed easier access to characters not in conventional typewriter character sets, such as [ and ]. The Selectric, unlike some typewriters still in use in the 1960s, had a 1 key (! with shift); some typeballs replaced 1 and ! with [ and ]. However, as IBM made keyboards for computers, a 1 key was necessary - a human reader can usually distinguish between l as l and l as 1, but a computer needs a 1.
Enter the IBM 2741 Communication Terminal, introduced in 1965. Unlike a modern terminal with keyboard and screen, the 2741 was "an IBM Selectric® typewriter with the electronic controls necessary to enable it to communicate with the System/360." You type at the keyboard, and characters are echoed printed on paper rather than on a screen (if echoing is on), and output from the computer is printed on the paper. The standard keyboard layout in 1972 was the standard Selectric keyboard:
Just as with the Selectric typewriter, the typeball could be changed, allowing different character sets. The IBM 1130 computer (which sold very well, with about 10,000 produced), also introduced in 1965, could use the 2741 terminal. The usual programming language on the 1130 was Fortran, but others were available. In particular, APL was available, and APL needed [ and ]. Typeballs to the rescue! With the APL Selectric typeball, the keyboard layout of the 2741 became
The 2741 was widely used, including by other computer manufacturers, and its conventions were widely adopted, becoming effectively standards.
With the 128 character ASCII character set, standardised in 1967 by IBM, with 32 control characters (codes 0 to 31, and 127) and 95 printable characters (space and 94 visible characters), there was a demand for keyboards with 47 keys, each printing 2 characters with the shift key in addition to the space bar and the various control keys. Thus, the keyboard expanded to the main section of the current US layout (not counting the function keys, arrow keys, numerical keypads, etc.). Since the ASCII character set included ( and ), [ and ], and { and }, [ and { could be paired together, and also ] and }, and ( and ) could be restored to their familiar-to-typists places with 9 and 0. Thus, the expanded keyboard was a hybrid of the conventional 2741 keyboard and the APL Selectric keyboard, expanded slightly.
Therefore, you can blame the deep typewriter roots of the modern QWERTY computer keyboard for the placement of ( and ). The 128 character ASCII character set, followed by keyboards capable of producing all of the printable characters in it, allowed newer computer languages to freely use all three types of brackets. FORTRAN 77 was the first Fortran to come after ASCII, but didn't add new brackets. C was developed after ASCII and ASCII keyboards were standard, and makes use of all three brackets.
References:
The Remington No. 2 keyboard photo is from https://www.antiquetypewriters.com/typewriter/remington-2-typewriter/
The standard 2741 keyboard layout and the quoted brief description of the 2741 are from the 4th edition of the IBM manual for the 2741: http://www.textfiles.com/bitsavers/pdf/ibm/27xx/GA24-3415-3_2741_Data_Terminal_Aug72.pdf