20

At least through the early 1980s, the source code in non typewritten computer manuals and books was usually typeset using proportional fonts, sometimes with syntax highlighting such as keywords in bold. When did these works start switching to unhighlighted monospace fonts for code? Was this shift driven by any particular technologies, production processes, or requirements?

I wonder whether the spread of formatting software like troff and TeX since the early 1980s, which provide good support for rendering code as monospace, may have driven or helped the shift.

I know many manuals and books published prior to the 1980s contained monospace source code, for example because they were produced with technologies that can output only monospace text. I'm specifically asking about other manuals and books, the ones for which there was at least a technical choice of fonts.

Paolo Amoroso
  • 1,520
  • 1
  • 9
  • 21
  • 9
    TeX doesn’t render code as monospace by default; on the contrary, as I recall Knuth’s own “paper” rendering of the literate-programming TeX program puts it in a proportional font. – user3840170 Jan 04 '24 at 16:25
  • @user3840170 Good point, I edited the question. – Paolo Amoroso Jan 04 '24 at 16:31
  • In proportional fonts, sometimes 1 renders like I - so does l (L). So something like Ill (ILL) could be read as 111. Even in non-proportional fonts, l and 1 look very similar. – cup Jan 04 '24 at 19:01
  • 12
    The 1977 IBM Fortran IV manual uses monospaced fonts for code. See https://bitsavers.org/pdf/ibm/series1/GC34-0133-0_FORTRAN_IV_Language_Reference_Feb77.pdf – Jon Custer Jan 04 '24 at 19:57
  • 23
    Probably since day 1, as teletypes and such did not have variable spaced fonts. – Erik Eidt Jan 04 '24 at 21:00
  • 7
    I heavily concur. Program code in manuals used what was available for printing, and that was monospace. And monospace was used not only for the program code, but for all other text as well. More elaborately typeset documentation that offered the choice of multiple fonts did only come up in the late 1970s/early 1980 (the bigger the vendor was, the earlier). Digital Research, for example, produced monospaced manuals for a long time. – tofro Jan 04 '24 at 22:21
  • 1
    Published Algol algorithms tended to use proportional fonts, maybe italics as well. But this was legitimate given the explicit distinction between the hardware language and the publication language :-) – dave Jan 05 '24 at 00:14
  • 9
    @tofro - 'what was available for printing was monospace' rather assumes that the typesetting of manuals was to be done on computers, but why should that be the case? Typesetting as a craft existed before computers, no reason to forget how to do it. – dave Jan 05 '24 at 03:10
  • @another-dave Oh, there are big reasons to forget that: Data transfer between the systems holding the example programs and the typesetter had to be established first, and that took some time: No good having a perfectly typeset manual with wrong code samples. The IBM PC manual, for example, made sure the BIOS listing was correct by reproducing a computer printout. – tofro Jan 05 '24 at 07:35
  • 3
    I would guess that your focus is on 'personal' computers and, as usual, my experience pre-dates that. Code could be and was set by professional compositors. It's a good deal simpler than mathematics text books, after all. – dave Jan 05 '24 at 12:37
  • 3
    @another-dave, Re, "assumes...typesetting of manuals was...done on computers, but why should that be the case?" Um, because the people who wrote the manuals spent their days* sitting in front of computer terminals? Sometimes you use the closest tool at hand. Also, it's not like there was any money to be made by professionally printing and binding computer manuals. I remember working from manuals that were comb bound xerox copies of originals that came off a line printer. – Solomon Slow Jan 05 '24 at 17:31
  • 2
    *Ha ha! Some of us, toiling away in a windowless office or machine room two levels below the street, often were oblivious to whether the time shown by the clock on the wall was AM or PM. – Solomon Slow Jan 05 '24 at 17:33
  • 3
    Creative Computing from volume 1, issue 1 in 1974 used monospace font for source code listings and proportional font for articles. – shoover Jan 05 '24 at 20:14
  • 2
    @shoover: The program listings in that magazine appear to be photographically reproduced computer printouts, and while articles were generally proportionally spaced, some editorial content appears to have been produced with a typewriter. – supercat Jan 05 '24 at 20:55
  • 3
    The focus on magazines etc. seems to be focussing on the bottom end of the market. There was money to be made in selling actual books (as I can attest, given the price of textbooks), which were designed by actual book designers. Manuals may be a grey area, though as I mentioned elsewhere, I'm biased by learning my craft in a time when my parents wouldn't shell out a few hundred thousand pounds sterling to by me a computer :-). – dave Jan 05 '24 at 22:45
  • I own published, typeset, FORTRAN and COBOL, graphics, accounting and math text books from the 70's. Code is monospaced, using fonts designed to imitate typewriter fonts. What are your examples of typeset publications where code was not monospaced? – david Jan 06 '24 at 10:29
  • 2
    This is (reasonable) speculation, so not an answer, but I suspect it had a lot to do with the equipment that the book publisher owned. According to my 1982 edition of the Chicago Manual of Style, phototypesetting was ubiquitous by the 1970s, but fully computer-generated imaging wasn't. Given that phototypesetting is based on physical letter masks, switching those masks to generate different portions of a page would be either impossible or extremely expensive. The alternative, leaving space for later paste-up of code samples, is also time-intensive (and therefore expensive). – kdgregory Jan 06 '24 at 12:10
  • 1
    @david: one example from my bookshelf is Threaded Interpretive Languages, published in 1981 by Byte Publications. The original VAX11 Architecture Handbook, published in 1979, is another, but it was published in-house by DEC, so maybe not a good example of what the mass market provided. – kdgregory Jan 06 '24 at 12:15
  • 1
  • @david - FORTRAN and COBOL had the notion of 'columns' baked into their definitions, so it seems unsurprising that manuals would render code examples in monospaced fonts. – dave Jan 10 '24 at 00:09

10 Answers10

24

Could you provide any base for the assumption that using proportional fonts was the most common way before 1980? My experience tells different.

Random example with text in proportional and code in fixed-width:

Now, what's true in my memory, and supported by peeking into some books, is that: books tend to use only a single type, fixed or proportional, throughout the whole publication. It's safe to assume that this reduced effort in typesetting.

Then again, even back then full listings were usually printed using fixed fonts. IBM's 1965 Fortran Specifications and Operating Procedures for the 1401 is a nice example. All examples / statements embedded in sections are using a proportional font, while (full) listings are made using fixed fonts - after all, that's the way to give an impression as close as possible what a programmer will see on punch card, print out or screen.

Very early documentation even offers another sub-type, where basic text including statements is printed depending on the default style, but all explicit code examples are made to look like programming forms with their fixed width structure. For example, this is seen in the 1960 IBM 1401 Symbolic Programming System Specifications.

Oh, and the 1967 /360 F-Assembler Programmers Guide even toppled all of this by using a fixed font throughout all text, but proportional when it comes to examples(*1).

I purposely picked very early books to show the origins. It continues the same way through the following decades. Likewise I showed IBM manuals only because there's a lot available online. Other manufacturers show the very same classes.

But similar style can be seen when looking at early computer magazines - although the very early ones don't have a lot of listings. One might guess that readers had to get computers before being able to send in programs. Though 'how to write' sections show that formatting was a professional job, not the authors' decision.


Regarding 'Typewriter' usage it should be noted that proportional spaced typewriters existed since the 1880 Hammond. That marvel not only supported proportional or fixed on the same device, but Italics and Bold as well. Those machines (and similar designs) were quite common with professional publishers. Its follow up models were produced until the late 1960s. Of newer origin would be the 1966 IBM Selectric Composer and 1972 MC Executive.


Manassehkatz' observation that use of multiple fonts/spacing became more common with the availability of typesetting systems does add meaning - except computer typesetting is a process that only started with minis and micros in the mid to late 1970s, but already in the early 1960s with mainframe-based typesetting systems (*2).


*1 - The /360 era also marks a point when IBM mostly switched to fixed font only for manual text. This changed again in the late 1980s.

*2 - Almost forgotten today, but those systems were such a big business that even special terminals were developed and manufactured by companies like IBM or Siemens. Newspapers foremost, but book typesetting as well. I still remember the programming for the 8162 type which had to be handled on interface level as three screens due it offering 72 lines of text :)

Toby Speight
  • 1,611
  • 14
  • 31
Raffzahn
  • 222,541
  • 22
  • 631
  • 918
  • 1
    but already in the early 1960s with mainframe based typesetting systems I'm well aware of that. But I think your typical small publisher - and except for IBM, DEC, etc. most software publishers were small in the 1970s and early 1980s - couldn't afford to make use of a mainframe typesetting system. – manassehkatz-Moving 2 Codidact Jan 05 '24 at 00:17
  • 4
    The code in that DEC TSS/8 manual looks like it was cut and pasted (you know, with actual scissors and glue) into the camera-ready copy, from teletype output. – dave Jan 05 '24 at 03:22
  • I agree. The people who were actually doing the work (i.e. operators etc.) very often got manuals which were produced on a drum printer and were likely to be updated on a regular basis, and where some important fragment needed to be reproduced for somebody who expected "a glossy" it would be directly derived from drum printer (or Teletype, Flexowriter etc.) output. – Mark Morgan Lloyd Jan 05 '24 at 07:17
  • @Raffzahn Maybe I wasn't clear but I qualified "source code in non typewritten computer manuals and books" to mean I wasn't referring to all manuals and books, just those where code wasn't already monospace. – Paolo Amoroso Jan 05 '24 at 07:46
  • 3
    The PET Computer User Manual that you linked uses a proportional font for its examples. Look at the word PRINT in any example that contains it and it is clear that it is using a proportional font. It's PRINT not PRINT – JeremyP Jan 05 '24 at 11:34
  • 1
    @PaoloAmoroso Not sure what you mean by typewritten, but the manuals selected were neither produced on typewriters (or printers), nor duplicated by photographic matters (that's why I selected early ones where that technology was still unavailable/too expensive). Those manuals have been typeseted the classic way using linotype style machinery. Also, excluding a common style of book typesetting style isn't exactly supporting the question. – Raffzahn Jan 05 '24 at 11:36
  • 1
    @manassehkatz-Moving2Codidact Typesetting wasn't an inhouse issue back then especially not "your typical small publisher" . That's a rather recent development made possible by closed digital production cycles. Publisher delivered their material as typed pages with instructions to the print house which turned those pages into the book layout according to mandatory instruction sheets. It was those print houses that could afford typesetting the linotype way who also switched first to computer based using mainframes. As usual a business detail most people never see. – Raffzahn Jan 05 '24 at 11:37
  • 1
    @MarkMorganLloyd Not really, above are printed manuals that have been typesetted. Of course there were as well read-me style manuals delivered on the same tape as the software, but those were not the same as above linked books (though there was a short phase before 1980 where IBM tried that - failed terribly). Of course, for the ones really operating the machines those printouts were usually the first (and last) documentation they got, so it' more present in our memory than the nice cut books management hoarded :) – Raffzahn Jan 05 '24 at 11:45
  • @Raffzahn By typewritten I mean produced with printers that already output monospace fonts, such as daisy wheel printers, or are already formatted with monospace fonts. I'll edit the question to clarify. – Paolo Amoroso Jan 05 '24 at 12:56
  • 1
    @PaoloAmoroso This is exactly why I selected those old IBM manuals. They are all typesetted, not produced by some daisy wheel printers (which were not a thing in 1960) - in fact, IBM Selectric, which would have been IBM's device of choice, was quite able to produce proportional output. The pint selecting those manuals of the same time is to show that use of proportional or fixed are select on purpose, not due necessity o/ tools used. IBM, as others, had all at hand to go either way - and they did. – Raffzahn Jan 05 '24 at 13:24
  • @Raffzahn: Neither any Selectric typewriter, nor any other IBM typewriter that could use the same type balls, could produce proportional type. The IBM Executive line of typewriters produced proportional-spaced text using type bars, and there was a type-ball-based typewriter that could do proportional spacing, but from what I read it was very expensive and rare, and its balls were incompatible with anything else. – supercat Jan 05 '24 at 19:35
  • 1
    @supercat The Selectric line is not the same as the Executive, which is an earlier different development. You may want to lookup the 1966 Selectric Composer. Likewise the MC Executive of197, which is, despite the name, a Selectric. – Raffzahn Jan 05 '24 at 21:18
  • @Raffzahn: The Composer is the expensive and rare machine I was thinking of. I'd forgotten that it was called the "Selectric Composer", but it was from what I read its mechanical workings were almost nothing like the rest of the Selectric line. I know the Executive is different from the Selectric--my point was that IBM had a popular line of typewriters that could do proportional spacing, and an even more popular line of typewriters that used interchangeable balls, but no popular product line that combined those features. – supercat Jan 05 '24 at 21:38
  • 1
    @supercat The Composer is mechanically a mostly standard Selectric. Popularity is not a point here as it'snot about Joe Average typing a letter. – Raffzahn Jan 05 '24 at 21:48
  • @Raffzahn: Even if the phrase "the Selectric" is interpreted as including obscure models that supported proportional spacing, I would not expect such a device to be used in leiu of a Linotype except when producing one-off documents or, perhaps, when cutting stencils or producing spirit masters. The "monospaced" example in another answer looks to my eye like it was produced via line printer, rather than a typewriter. – supercat Jan 05 '24 at 22:56
  • 1
    @supercat The Composer was in no way 'obscure' but quite successful. Just because it wasn't something everybody needs doesn't make it 'obscure'. Also it doesn't help if you twist what is said. The point is about that proportional typewriters were as available and in use, so the term 'typewriter' alone doesn't hold any value to exclude books. – Raffzahn Jan 05 '24 at 23:09
  • Typesetting wasn't an inhouse issue back then especially not "your typical small publisher". - This must be an assumption, because it's not true. I worked as an apprentice printing machinist in the mid '80s for a very small publisher. We had an already ancient Linotype only the boss knew how to use, and a computerized film phototypesetter that I was almost as fascinated by but was never shown how to use. We were such a small publisher that I don't know what we published as we mostly did office stationery, wedding invitations, and the like. I doubt we were very atypical. – hippietrail Jan 06 '24 at 05:56
  • 1
    Oh I nearly forgot, a friend of mine even before my apprenticeship, 1980-82 era, had a dad who was an even smaller publisher working out of a home office. He used what I assume was a regular consumer level IBM Selectric golfball typewriter. We were allowed to use the TRS-80 Model 1 with Exidy Stringy Floppy, but we were forbidden from touching the Selectric. So I suppose it depends how small is "small". My print shop had 3 machinists, 2 in the art/typesetting department, 1 who only used the computerized film typesetter, and the boss and secretary/receptionist in the office. – hippietrail Jan 06 '24 at 06:03
  • 1
    @hippietrail Sure it was a publisher, not a printshop? But then there are as well way bigger publishers without - For example some of the largest pocket book publishers in Germany (dozend or more titles a month) didn't have in house printing. I would bet that even in your small company there was a workflow established with a clear distinction between publishing (lectoring / preparing a book) and typesetting. That is past wedding invention of course :) (Stringy Floppy ... neat!) – Raffzahn Jan 06 '24 at 12:08
  • @Raffzahn I mostly only worked on the presses and the dark room making printing plates. I believe my boss took over the place from his father and that it had been there for quite a long time so maybe they did more publishing before I was there or maybe it was only ever very very small-time. I remember one thing we published and printed was a very small book, almost a pamphlet, on Aboriginal words. I found its ISBN: 0858080087. I don't think we ever did a new run while I was there but there were some copies or boxes around. – hippietrail Jan 06 '24 at 14:41
  • Comments have been moved to chat; please do not continue the discussion here. Before posting a comment below this one, please review the purposes of comments. Comments that do not request clarification or suggest improvements usually belong as an answer, on [meta], or in [chat]. Comments continuing discussion may be removed. – Matt Lacey Jan 08 '24 at 16:38
  • This overlooks the phototypesetting machines available from the 1960s that could produce a limited range (read manually change typeface masters) of fonts with restricted variability. Usually, both fixed and proportional width text was available easily within a single typeface.

    The oldest reference I have seen to mini-computer typesetting was for an IBM 1130 Typesetting System that generated paper tapes for (and potentially directly controlled) a linecasting machine, predating phototypesetting.

    – Pekka Mar 08 '24 at 13:46
  • @Pekka Topic is about font use, not technology used to produce them. – Raffzahn Mar 08 '24 at 17:33
  • @Raffzahn That is clear. The fact that the machines only had one typeface available at any one time would likely affect the number used in a document. On machines I have seen, but not worked on, changing the type cartridge was more complex than changing a golf ball or daisy wheel in a printer. Linecasters supporting up to four typeface were available, of which often only one magazine could be used on any one line. This would have been something the typesetter would have considered during publication design. – Pekka Mar 09 '24 at 00:40
21

Eating your own dog food

Computer manuals for "real" publication, as opposed to just internal use within a company, were typeset using traditional methods. When you are typesetting manually, or minimally computer assisted, switching between different fonts, including (perhaps even more so) switching between proportional and mono-spaced fonts, is extra work. It was only in the 1970s that minicomputer-based typesetting became available, and it really took the microcomputer to put this in the hands of small companies. On top of that, the output was a problem. Even if you could see the different fonts on the screen (nominally, not actually true Wysiwyg for most people until the mid-1980s at the earliest), unless you had expensive typesetting equipment your options were extremely limited (dot-matrix - poor quality, daisywheel - good quality but only one font at a time) until the laser printer.

All of that put together meant that your practical, affordable options until ~ 1984 were:

  • Dot-matrix printout - generally monospace (and visible dots) for text and code.
  • Daisy-wheel printout - generally proportional for text and code.
  • Professional typesetting - generally proportional, but mono-space available for code if you were willing to pay for it, for text and code.

1984 changed everything. The Mac was the consumer-level/small-business start of desktop publishing with Wysiwyg. And yes, other programs came along on the PC side too. Plus the laser printer - HP LaserJet in 1984, Apple LaserWriter in 1985 - made it possible to use an affordable computer to produce camera-ready output under full and easy control of the author. It was no longer:

  • Type up a document and send it (whether paper or floppy disk or via modem) to a publisher
  • Publisher typesets and returns proofs to the author (paper)

but instead the author could produce an entire manual, ready to reproduce, in house, with professional quality type (300 dpi). Once you have that, including mono-space code makes a lot of sense as it matches the way most coding is done on-screen.

  • 2
    Who is the dog food producer and what is the dog food? – user3840170 Jan 04 '24 at 23:38
  • 5
    Computer software companies using the systems they write software for and or sell to write the documentation for those systems. – manassehkatz-Moving 2 Codidact Jan 05 '24 at 00:02
  • 2
    So it’s “dogfooding” for a software company to use the same PCs they did not manufacture as the target platform for their software and as the workstations on which they write documentation? Seems like a stretch. – user3840170 Jan 05 '24 at 09:48
  • 1
    "mono-space available for code if you were willing to pay for it" - not really. mixing fonts was daily business for typesetters - font family support being a standard, supported by classic typesetting machines at key press (it's really awe inspiring to see them work). All it needed for a customer was filling out the right boxes in the "Auftrag und Satzanweisung" (no idea about the English term, literally "Order and typesetting directions".). Think of it like all the settings one does in a text editor to define header, paragraph, etc. attributes globally before starting to write. – Raffzahn Jan 05 '24 at 13:40
  • @Raffzahn I dealt with a couple of small projects involving typesetting (output was on film and physically cut/pasted for layout) - don't remember exact timing, but must have been late 80s or early 90s. It was tedious. Mixing fonts was more complicated than just "point and click", etc. That was with a very small shop, presumably larger places had more efficient ways of doing things, more sophisticated equipment. But from what I saw there, and what I saw not much later (really already starting at the time as this was > 1984) was a huge difference. Doing it yourself on the equipment you already – manassehkatz-Moving 2 Codidact Jan 05 '24 at 15:17
  • had for software development, etc. (even if it wasn't strictly "eating your own dog food" unless you produced word processing software) was a huge change because it took the extra people/processes out of the loop. – manassehkatz-Moving 2 Codidact Jan 05 '24 at 15:18
  • 5
    Small nitpick: In the typesetting world, 300dpi was not professional quality. 9-pin and 24-pin dot matrix printers could produce "Near Letter Quality," daisy wheel & 300dpi laser printers were considered "Letter Quality," but the optical & film systems that were used in professional typesetting were (if memory serves) akin to 1200+ dpi. Source: I was a typesetter for a small-town print shop in the late '80s-early '90's. – zmerch Jan 05 '24 at 20:12
  • 2
    @manassehkatz-Moving2Codidact Sounds like you worked that at a time when users already tried to do parts of the typesetting job on their own. Printing workflow before that, did not have the author do any of that. There were no 'sophisticated equipment' at the author side, no matter what tools typesetter and printer used. One delivered everything single sided, 2 line spacing. Any special formatting -including insertion of pictures or graphs - was written in text and marked with some (company specific) signature. All of that described every time again in the preceding Satzanweisung. – Raffzahn Jan 05 '24 at 21:10
  • @zmerch I'm well aware of that. But for the typical small business where the publication (eg program documentation) was ancillary to the actual product, 300dpi was good enough. And many times I got documentation that was daisy wheel or even dot matrix – manassehkatz-Moving 2 Codidact Jan 05 '24 at 21:14
  • @user3840170: Dogfooding is the practice of using one's own products or services, even before they're considered "finished" and released to consumers. This is a general software term, originating in Microsoft wikipedia link – Jonathan Jan 07 '24 at 09:54
  • @Jonathan Exactly, and what this answer describes isn’t an example of that. Spare me the Wikipedia link. – user3840170 Jan 07 '24 at 14:00
12

In the 1980s, many magazines incorporated source code in the form of photo-reproduced computer printouts, which were naturally monospaced. In situations that didn't use actual computer printouts, for computer source-code programs in many languages, proportionally spaced text is preferable to monospaced text except when certain issues arise, but use of a monospaced font avoids such issues. For example, if one has a multi-line comment in a programming language that uses fixed line breaks, and has no way of knowing what font the program will be rendered in, there may be no practical way to edit the text to yield a reasonable-looking right margin for all fonts the viewer might use. This may be a problem for some ways of presenting the text, but would not be a problem in something like a book whose choice of font is set in stone (or, more likely, lead or aluminum) when the book is published.

Another consideration may be that many font libraries for conventional type setting haven't included complete monospaced fonts (as opposed to sets of monospaced numerical digits) because laying out text in a monospaced font required more work than laying out proportionally-spaced text and offered no real benefit. Note that even typewriter-like text was often set using a font like Rockwell, which is a proportionally-spaced font which is stylistically similar to Courier, rather than an actual monospaced font. As sans-serif fonts have become more popular in text editors, they've also taken over when representing literal source text, but the less distinctive letter shapes make it desirable to use letter spacing as well as letter shape to distinguish such text from the surrounding content.

supercat
  • 35,993
  • 3
  • 63
  • 159
  • 1
    In 1983 I was typing in ZX81 code from magazines. Some even reproduced the tractor holes. – Michael Harvey Jan 04 '24 at 22:58
  • 2
    I'm pretty sure I had magazines whose code was printed on ZX Printer, with its appalling horizontal alignment. – Toby Speight Jan 06 '24 at 08:58
  • 1
    @TobySpeight I think I saw that in Personal Computer World in 1983. Does this look like it? Page 228 of the scanned magazine https://www.worldradiohistory.com/UK/Personal-Computer-World/80s/PCW-1983-08-S-OCR.pdf – Michael Harvey Jan 06 '24 at 16:04
8

In code, unlike natural printed text, spacing is sometimes important.

In proportional fonts, the width of a space is not the same as the width of all characters. (It may be different than the width of any character in that font.) This is the definition of proportional viz. fonts.

Also, a block of text may be justified by changing the width of spaces (sometimes both inter-word and inter-character) in a proportional font.

In some languages, variable spacing is problematic.

Specifically, FORTRAN, which was in common use when this change became common, was very particular about spacing. It could get extremely difficult or impossible to fix one's own code in a proportional font.

Even in languages where whitespace is insignificant, there are programming styles where spacing is significant. Consider this:

TOP_CENTER_LENGTH = 53
DURATION          = 6
INTERVAL          = 3000

in comparison to this:

TOP_CENTER_LENGTH = 53
DURATION = 6
INTERVAL = 3000

which are different in terms of readability.

Edit: whether required or not, in many older languages (like perl and C) and most newer languages, spacing denoted structure. Compare the readability of:

void run_me(int x, int y) {
    for (int i = 0; i < y; i++) {
        x += y;
        if (i * y < x) {
            x++;
        }
    }
}

versus the wholly illegible yet functionally equivalent:

void run_me(int x,int y){ for(int i=0;
i< y; i++){x +=y; if(i*y<x){
x++;}}}

If you wanted anyone to ever look at your code, your code would have to look like the first block or you'd need to find someone who was very motivated to read it.

Historical significance

It should also be noted that before we had this nifty thing where we could all communicate magically over radio waves and light beams in glass tubes, code was often distributed in print and even magazines. It would have been very difficult or impossible to key in a FORTRAN program in a proportional font. This was more common at some point than it would be considered by most, now.

But... when?

This was before my time so I don't have specific memory of it, but Wikipedia has a good article on type-in code. There's information in there about the history of it.

  • As an ancient Fortran programmer I fully concur. In Fortran spacing is part of the syntax of the language, and trying to copy and align code with columns on a punch card needed code source material to be printed in a monospace font. An additional aspect you may wish to include: in both old and new programming languages, indenting code from the start of a line using spaces and/or tab characters is used to indicate code structure, so that when reading you can skip blocks of code that are related but not what you are looking for with ease. This remains hugely important to this day. – traktor Jan 06 '24 at 06:42
  • However, Fortran 66 or 77 standard documents do not use a typical typewriter font. Maybe it is monispace, but it is a cut very similar to the rest of the text, just in capitals. – Vladimir F Героям слава Jan 07 '24 at 08:13
  • @traktor, yes, thanks, edited. We hope people indent and sometimes they don't and we cry. :-) – Stephan Samuel Jan 12 '24 at 15:48
  • Code indentation with a proportional font still works as long as the 'space' character has a single fixed size. Which isn't necessarily true for cold-metal typefaces, but could be enforced for hand-typeset code. – dave Jan 13 '24 at 14:42
7

The IBM 709/7090 FORTRAN Reference Manual (copyright 1958, 1959, 1961) uses the same font for code as text, except that the code is in all capitals. A serif font is most of the text, a sans-serif font is used for section and sidebar markings. Text is not justified. One example looks like:

1971 manual

By the 1966 IBM System/360 Fortran manual the font is still mono-spaced, but text is justified. The font is a serif font. It now looks like:

1966 manual

The 1977 IBM Series/1 Fortran manual is back to having unjustified text, but has gone to fancier use of fonts, including bolding and italics. All are serif fonts. But, actual code is in a different font from the text:

1977 manual

So, in all cases the code is a monospaced font. The text is as well mind you, and the various versions have adopted a variety of formatting choices. I find it interesting that the plainest formatting is the 1966 version, the one in the middle.

Jon Custer
  • 1,328
  • 1
  • 12
  • 19
  • 3
    “the font is still mono-spaced” – but the example before is not. Editing error? – user3840170 Jan 06 '24 at 17:24
  • 1
    709/7090 FORTRAN is not monospaced. – manassehkatz-Moving 2 Codidact Jan 07 '24 at 03:26
  • The manuals are a somewhat specific thing produced by the companies on some budget. But look also at national and international standards for Fortran 66 or 77 or some books published by real book publishers. Most examples shown there is a single line so the necessity to align lines 1-7 does not arise that much. Maybe the font is after all monospace, but the cut is very similar to the rest of the text. – Vladimir F Героям слава Jan 07 '24 at 08:11
5

To answer the 'why' part of the question:

There are two reasons to use monospaced fonts for code.

  1. It is good practice to visually distinguish various types of information in a manual. Notes and warnings get an icon, a procedure with steps uses numbering for each step etc. You want to distinguish code from the rest of the text as well: this is information that has to be typed into the computer, unlike the rest of the manual. There are several ways to do this, using a monospaced font emerged as the standard method. And it's a logical standard, as it emulates what the code looks like as you enter it.
  2. in code, it is essential to use the correct symbol. Sans-serif fonts have two major problems in this regard: lowercase L and uppercase i are too similar, and 0, o and O are too similar. Monospaced fonts are generally designed to solve this, e.g. by using serifs and by adding a slash through the zero.
Hobbes
  • 481
  • 2
  • 4
  • 'Slash through zero' is a local convention, or at least used to be, before US terminology and conventions conquered the world. In ICL publications, and on the coding forms I wrote up for keypunch operators, zero was unslashed, and 'oh' had a horizontal bar, like a capital theta (the presumption being that zero was more frequent than oh). The lineprinter output I have shows neither as slashed. – dave Jan 05 '24 at 14:21
  • 1
    Point #2 seems to conflate serif/sans-serif and proportional/monospaced. A proportional serif'd font can solve the eye-versus-ell problem. See good old Times Roman. Apart from that, I think you missed what I consider the most important reason for using monospaced fonts in manuals -- you're using one of 'those' languages where it matters what column things go in. – dave Jan 05 '24 at 16:12
  • Generally, serif fonts solve the L/i problem but not 0/o/O. – Hobbes Jan 05 '24 at 16:56
  • Monospaced fonts are common, decades after the last of the 'column nr is important' languages became obsolete. – Hobbes Jan 05 '24 at 16:59
  • 1
    @Hobbes: If comments will contain tables, or even paragraph-formatted text with hard line breaks, proportional fonts are likely to cause problems. – supercat Jan 05 '24 at 19:29
  • 1
    Monospaced fonts don't solve the 0/o/O problem just by the simple virtue of fixed spacing. I have lineprinter output to confirm that. It is glyph design (whether by putting a slash on zero, or by making "O" squarer than "0") that solves that, and you can do that in a proportional font just as well, Maybe better, as this comment illustrates in this browser. One could well regard the slash as a a crude hack to work around the ambiguity caused by fixed-width characters. – dave Jan 05 '24 at 22:36
  • Yes, obviously. Monospaced fonts are generally designed to take this into account, while general serif fonts aren't. – Hobbes Jan 06 '24 at 09:32
5

Any printed code that was not mono-spaced would drive many programmers crazy, myself included. I have to believe that any books or magazines which used variable width text for code was edited by people who didn't program. They probably were going by some style guide which didn't envision the importance of indenting, columned data, and the "structure" of structured programming.

OTOH, I guess if the programmer didn't care how his code looked, he could have been perfectly happy with proportional fonts.

In direct answer to your question, I believe the premise to incorrect. Good programming sources use fixed-width fonts for code, and to my knowledge always have.

RichF
  • 9,006
  • 4
  • 29
  • 55
  • There are plenty of examples of articles set in proportional typefaces by programmers with better credentials than you or I. The first example I grabbed from my library was Informal Introduction to Algol 68, by Lindsey and van der Meulen. Take a look at that before claiming that they didn't care how it looked. – dave Jan 13 '24 at 15:00
1

I have a couple of Multics manuals from 1975. Straight-up monospace. Emphasis is by underlining. Undoubtedly formatted with runoff (ancestral to Unix nroff), which could justify monospaced text only.

John Doty
  • 2,344
  • 6
  • 12
0

Very likely before you were born. I started programming for money in 1969. At that time, we didn’t have any other fonts.

  • 2
    Charlie, we've had fonts since Gutenberg invented moveable type. The point is that there's no inherent need for books about computers to be printed on devices attached to computers. I learned Algol in large part from the Revised Report, and it wasn't shy of using multiple fonts for code, though whether it's monospaced or proportional seems to depend on where you read it. (Welcome to Retrocomputing, despite this criticism). – dave Jan 10 '24 at 00:00
  • Im so old. Computers had only one font. Details varied but they were all monospace fonts. Programming languages often depended on monospace fonts — COBOL, FORTRAN, RPG assemblers, all column dependent. The problem still shows up in Python, where '\t' and '\b\b\b\b\b\b\b' look the same but parse differently.

    Thanks for the welcome, but I was doing retro-computing back when it was cutting edge.

    – Charlie Martin Jan 30 '24 at 16:41
  • I'm so old, computers had no fonts at all. Different I/O devices had typefaces, often quite different to each other. I reject the notion that a programming language designed for punched cards had any dependency on fonts whatsoever. What mattered was which card column something was punched in; and if you had the services of a keypunch operator, that in turn depended on which square on the coding sheet you wrote it in. (Oh, and 'tab' on a keypunch just moves to a particular column, nothing is punched on the card). – dave Jan 30 '24 at 22:14
  • Right, typefaces not fonts. Son, you need google. – Charlie Martin Feb 03 '24 at 15:11
  • You're correct: typical output devices (lineprinter, teletype) of the time had a single font (of a single typeface). But the salient point is that the computer had no font to call its own. – dave Feb 03 '24 at 15:28
  • Which might explain why the original question asked about monospace fonts. – Charlie Martin Feb 13 '24 at 01:06
0

The Style Manuals that dictated how documentaion was to be produced and presented. These typically dictated the use of fixed spaced fonts for computer code examples.

As an example the HP Help System, Developers Guide, although this is version 3.0 the first copyright date is 1988.

Glossary, Page Glossary-1

example listing

A body of text in which line breaks are left as they are and which is displayed in a computer font. The text is typically an example of a portion of a computer file. Example listings are entered using the ex or vex elements.

Help Tag Markup Reference, Page 11-16

Computer example Shows computer text without changing the spacing or line breaks.

PDP11
  • 718
  • 2
  • 12