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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Is there a readability metric for source code?

1 点作者 aratno将近 5 年前
I’m imagining something like the Flesch-Kincaid test for source code: https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Flesch%E2%80%93Kincaid_readability_tests<p>I’m assuming it would have to be language-specific.<p>This is particularly interesting for contextualizing terse code, like Gocker shared here recently, which may have readability benefits in its brevity that is undone by use of obscure features and structure (like code golf).<p>Can anyone share existing discussion of this idea?

1 comment

magixx将近 5 年前
I believe cyclomatic complexity is related to what you&#x27;re looking for. <a href="https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Cyclomatic_complexity" rel="nofollow">https:&#x2F;&#x2F;en.m.wikipedia.org&#x2F;wiki&#x2F;Cyclomatic_complexity</a> There are tools&#x2F;plug-ins available which try to measure this which could result in less complex and thus more readable code.