TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

The Tyranny of the Hollerith Punched Card (2012)

36 点作者 vu3rdd将近 11 年前

13 条评论

vidarh将近 11 年前
Personally, while my <i>windows</i> are far wider than 80 characters, my code generally use shorter lines for a simple reason: readability. It&#x27;s faster for me to scan a code fragment if I need to move (scroll the code, move my eyes) only on one axis. I use wider windows because it is convenient to split in two, to let me switch between files while keeping other files up in a fixed location.<p>The 80 width &quot;limit&quot; has survived to the extent it has not <i>just</i> because of tradition and compatibility, but also because it fits well within the range of what is most comfortable for most people.<p>Add to that the desire to ensure fixed-formatted text like code will be readable also on <i>other peoples</i> screens, and it becomes relatively irrelevant if you can fit 200 character lines on <i>your</i> screen and have eyesight that makes that comfortable even when using smaller screens, and don&#x27;t mind moving your head all over the place.
评论 #7858524 未加载
评论 #7859372 未加载
Stratoscope将近 11 年前
Another interesting question: Where does the traditional 25-line height of a default terminal window come from?<p>Obviously it came from the 80x25 character mode displays of old CRT monitors. The IBM PC had an 80x25 monochrome display, but it was just mimicking older CRTs from the &#x27;70s.<p>Where did those displays get their dimensions: usually 80x25, sometimes 80x24?<p>It can&#x27;t be punched cards. There&#x27;s nothing particularly special about a deck of 25 cards vs. 21 or 29 or whatever.<p>It isn&#x27;t the Teletype machines we used back in the day. Those use a continuous roll of paper.<p>In fact the first time I saw someone using a &quot;glass teletype&quot; at Tymshare where we all coded on Teletypes, I wondered what you would do when something scrolled off the top of the 25 line screen. Teletypes were noisy, but the paper coming out the top gave you an infinite scrollback buffer!<p>So why 25 lines?<p>I think it came from the standard coding forms used for FORTRAN and other languages in the &#x27;50s:<p><a href="http://www.atkielski.com/PDF/data/fortran.pdf" rel="nofollow">http:&#x2F;&#x2F;www.atkielski.com&#x2F;PDF&#x2F;data&#x2F;fortran.pdf</a><p>(BTW if you want an authentic FORTRAN Coding Form of your own, that PDF prints beautifully on 8.5 x 14 legal-size paper.)<p>There you have it: six groups of three lines each, 24 lines on your coding form. So an 80x24 display was a perfect match for a standard coding form.<p>Add a status line at the bottom of the CRT and you have your 80x25 terminal.
评论 #7859067 未加载
评论 #7859570 未加载
评论 #7860371 未加载
upofadown将近 11 年前
It&#x27;s interesting that this old saw comes up with the implication that 80 columns is not enough. Back in the day, Forth programmers wanted to put their source in binary length blocks. They picked 64 columns rather than 128. Forth is a particularly concise language, but the point still exists.<p>Why is more always considered better?
sbierwagen将近 11 年前
<p><pre><code> Why? Because (and here, we finally get to the real answer), that&#x27;s how wide a Roman chariot needed to be, in order to accommodate the width of the war horses pulling it. So, in some sense, the width of cars is not only an artifact of the way that things had always been, but is also an extension of the tyranny of Caesar. Remember that the next time you go pick up some groceries. </code></pre> <a href="http://www.snopes.com/history/american/gauge.asp" rel="nofollow">http:&#x2F;&#x2F;www.snopes.com&#x2F;history&#x2F;american&#x2F;gauge.asp</a><p><pre><code> This item is one that, although wrong in many of its details, isn&#x27;t completely false in an overall sense and is perhaps more fairly labeled as &quot;Partly true, but for trivial and unremarkable reasons.&quot;</code></pre>
GregBuchholz将近 11 年前
Maybe more interesting is why we&#x27;ve retained some of the limitations of the past, while moving beyond others. 80 characters probably isn&#x27;t as constraining when your variable names are limited to 6 character (as in Fortran77), and seem more constraining for identifiers like &quot;MemberSubmissionAddressingWSDLParserExtension&quot;.<p><a href="http://www.pushing-pixels.org/2007/11/07/and-the-longest-jre-class-name-is.html" rel="nofollow">http:&#x2F;&#x2F;www.pushing-pixels.org&#x2F;2007&#x2F;11&#x2F;07&#x2F;and-the-longest-jre...</a>
crazytony将近 11 年前
In the early-aughts I worked for a small web software company that used Microsoft systems for development and production. We got bought out by a larger &quot;professional&quot; dev house (that also developed on MS products) and a new edict issued (so we could be professionals): we needed a STRICT coding standard. 80 chars per line NO EXCEPTIONS. Of course that was the only rule set in stone for all languages.<p>Even the plain, flat HTML files had to be less than 80 chars per line.
NoMoreNicksLeft将近 11 年前
Any coding style that benefits from indentation is strangled by 80 chars. I still need to set up a ruler on Sublime, or else over the course of a week the lines will progressively get longer because I&#x27;m unwilling to break for just a few characters without it, but we&#x27;ve all decided to do 120. Hell, if only for comments, I don&#x27;t want those to be newspaper columns.
vorg将近 11 年前
If the line of code has many narrow characters (like <i>i</i>, <i>l</i>, <i>t</i>, <i>f</i>, parens, comma, and dot) and few wide characters (like uppercase or Chinese characters in your identifiers) then you can have much more than 80 characters on a line IMO.<p>Or were you advocating breaking the 80 chars per line restriction, but not the fixed-width font restriction?
评论 #7857750 未加载
评论 #7858067 未加载
dodders将近 11 年前
My day job used to involve coding in RPG which still enforced 80 column formatting as of the late 90s, where specific columns have specific meanings and are populated with indicators that represent types and instructions. This is a direct result of programs being written using punched cards, but was carried into the interactive environment as well.<p>Examples here: <a href="http://en.wikipedia.org/wiki/IBM_RPG#Example_code" rel="nofollow">http:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;IBM_RPG#Example_code</a>
unhammer将近 11 年前
But why was the Hollerith card 80 chars wide in the first place?
评论 #7858716 未加载
JoeAltmaier将近 11 年前
No need anywhere to observe this limit any more. Its only in our heads folks! Just rebel. I do - my lines are as long as they need to be.
评论 #7858476 未加载
abrowne将近 11 年前
(2012) [based on the URL]
评论 #7859673 未加载
blt将近 11 年前
I have never worked on a software team with a hard 80-column limit, FWIW. It&#x27;s always more of a suggestion.