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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Programming Languages vs. Fat Fingers

42 点作者 petsos超过 12 年前

7 条评论

kps超过 12 年前
As a historical note, the Mercury period-vs-comma¹ bug probably wasn't a <i>typo</i> as such. In that era, programmers didn't type their programs; they wrote them on paper, using special printed forms² so that their intent would be clear to the professional typists who entered it. To prevent typos, everything would be typed at least twice; in the days before diff, there was special-purpose hardware for this.³<p>I can think of three possibilities for the programmer making such an error: actually writing it wrong (which seems unlikely to me because the mental context of writing a loop range doesn't lend itself to writing a single number); a skipping pen; or a locale issue — i.e. a programmer of European origin mixing up the characters.<p>¹ <a href="http://catless.ncl.ac.uk/Risks/9.54.html#subj1.1" rel="nofollow">http://catless.ncl.ac.uk/Risks/9.54.html#subj1.1</a> ² <a href="http://en.wikipedia.org/wiki/File:FortranCodingForm.png" rel="nofollow">http://en.wikipedia.org/wiki/File:FortranCodingForm.png</a> ³ <a href="http://en.wikipedia.org/wiki/Keypunch#IBM_056_Card_Verifier" rel="nofollow">http://en.wikipedia.org/wiki/Keypunch#IBM_056_Card_Verifier</a>
Someone超过 12 年前
I cannot find how they controlled for the wordiness of the different languages. They changed one token in each file, but the number of tokens per file might be different. For example, Python likely will be shorter than Java due to its significant whitespace.<p>Also, the 'replace a single character in a token by noise' change may have hugely different effects, not only because of differences in keywords (begin…end vs {…}) but also, and probably more so, because of average variable and function name length (for the languages tested, this is a cultural issue, but it would not surprise me if the effect were large. You won't find 'FooFactory' in a perl program)
评论 #4895303 未加载
Too超过 12 年前
So, assuming all typos inserted are in fact a serious error to the program and assume that the output they used to compare is a unit test. Then an interesting number to look at is:<p><pre><code> Errors remaining = Successful run - Faults caught in unit test </code></pre> In that regard most languages in the study are quite equal. Although with the static languages you most likely catch the errors much earlier and you probably get a much better hint of <i>where</i> the error is, instead of just an assertion that you have an error. And of course this assumes that you <i>do</i> have unit tests.
lucian1900超过 12 年前
This basically studies how impactful typos are for these various languages. Well, typos are always trivial to find and fix.<p>It's more serious issues that I would want a type system to help me with (like null references, concurrent access, etc.)
评论 #4894694 未加载
ckakman超过 12 年前
Nice article that show some of the virtues of statically-typed languages.
评论 #4894577 未加载
Tyr42超过 12 年前
I find it funny that Java scored very similarly to Haskell, when otherwise the languages are quite different.
评论 #4895252 未加载
fox91超过 12 年前
I don't see any value or meaning in this "experiment". What should it demonstrate?
评论 #4894748 未加载
评论 #4894637 未加载
评论 #4894858 未加载