Kevin O'Mara
1 min readAug 19, 2019

--

The 80 column limit originated when Herman Hollerith got the contract for the 1890 US Census, using 80 column punched cards to process the data. His company eventually became IBM.

In many ways the 80 column “convention” is much like the width between the rails of a railroad track. That width matched the width of a Roman chariot’s wheels because early railroads used old Roman roads designed for chariots.

That said, the important issue is readability and its impact on maintaining reliable code. As many have noted when a line gets too wide it becomes more difficult to read and comprehend. Likewise there is value in getting one complete “thought” on a single line — wrapping lines has its own problems.

I don’t think any arbitrary number — 80, 120, 96 will work for all languages in all situations. For example I work mainly in iOS, whose Frameworks are notorious for long method and constant names — e.g., outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:baseAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shouldColorMatch:. Each : delineates an argument so you could put each argument on a separate line. That’s the best answer I have to readability — but it takes 9 lines. Not great IMO.

--

--