8

统计 Matlab 代码量

 3 years ago
source link: https://zhiqiang.org/coding/how-many-codes-have-you-written.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

统计 Matlab 代码量

作者: 张志强

, 发表于 2011-03-25

, 共 372 字 , 共阅读 231 次

写了一个统计代码量的函数,函数已上传到 Matlab Central File Exchange下载地址,使用方法:

MCount.lines(directory_path) 统计目录下 m 文件总代码行数。

MCount.reallines(directory_path)统计目录下代码行数(不计空行和注释行)。

MCount.size(directory_path) 统计目录下代码总文件大小。

到公司最近半年才开始大规模使用 Matlab ,统计了一下我在过去半年写了的成果:

  • 19537 行
  • 12320 行(去除空行和代码行)
  • 代码文件 603K (只统计.m 格式文件)

有 27%的行为空行和注释行,看来我写的注释还是挺多的 :D 。听说要想成为一门编程语言大师,至少得写 10 万行以上程序,这样看我还差得远,努力努力。

Q. E. D.

avatar-0.jpg

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK