为什么有些功能非常长的? (需要思想为学术研究!) [英] Why are some functions extremely long? (ideas needed for an academic research!)

查看:156
本文介绍了为什么有些功能非常长的? (需要思想为学术研究!)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写很长的功能一个小的学术研究项目。很显然,我不是在寻找<一href=\"http://stackoverflow.com/questions/652788/what-is-the-worst-real-world-macros-$p$p-processor-abuse-youve-ever-come-across\">examples对于不好的编程,但对于100,200和600线长函数的例子这是有道理的。

I am writing a small academic research project about extremely long functions. Obviously, I am not looking for examples for bad programming, but for examples of 100, 200 and 600 lines long functions which makes sense.

我将调查使用了的硕士学位写在希伯来大学,衡量不同的参数,如code的行数的功能复杂(中冶衡量)和其他东西。顺便说一句,这是关于code分析一个整洁的学习,并推荐阅读材料。

I will be investigating the Linux kernel source using a script written for a Master's degree written in the Hebrew University, which measures different parameters like number of lines of code, function complexity (measured by MCC) and other goodies. By the way, It's a neat study about code analysis, and a recommended reading material.

我有兴趣,如果您可以想到的任何好的理由的功能应该是非常长的吗我会寻找到C,但在任何语言的例子和论点会有很大的用途。

I am interested if you can think of any good reason why any function should be exceptionally long? I'll be looking into C, but examples and arguments from any language would be of great use.

推荐答案

我可以赶上高射炮这一点,但可读性。高度串行的,但独立的执行可能被打破成N的函数调用(的被用于其他地方的功能)并没有真正从分解受益。除非你满足于功能长度任意最大的一项福利。

I may catch flak for this, but readability. A highly serial, but independent execution that could be broken up into N function calls (of functions that are used nowhere else) doesn't really benefit from decomposition. Unless you count meeting an arbitrary maximum on function length as a benefit.

我宁愿通过code N个功能大小的块滚动,以比浏览整个文件,打N个函数。

I'd rather scroll through N function sized blocks of code in order than navigate the whole file, hitting N functions.

这篇关于为什么有些功能非常长的? (需要思想为学术研究!)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆