个人作业Week3

一.个人感想

  推荐的文章比较多,我也是有空就看一个,有点想法就记下来,所以不准备写一个完整的感想,打算写成一个随笔。

一直在路上——记我从初中到本科近十年的学习成长历程

  文章开头说到的偏科我也是感同身受,因为高中我的双语一直是在及格线附近徘徊。当然到了大学,语文的影响就没什么了,不过英语还是一个痛啊。

  虽然上的大学要比作者要好些,但我感觉自己到现在为止并没有作者学到的东西多,毕竟在上大学前,我也对是编程一无所知。而大一呢,学的是各种数学(当然我并不否认数学的重要性),除此之外只有一门C语言,而且偏向于语法练习。大二其实也就学会了如何使用Java和C++编程,系统点的也就是计组了。所以到了大三,自己内心其实是非常虚的,看到自己身边的同学已经开始搞各种项目,做网站,app之类的,真的非常渴望自己也能学到这方面的知识。这也是我坚持选这门软工的主要原因。

  后来作者讲到的毕业之后的生活,虽然他并不是什么大牛,但刚毕业就能成为一家小公司的编程核心,这让我想到平常上课时有很多老师都曾讲过我们毕业后作为一名程序员年薪其实还是很高的,大家一直都很不相信,认为那是大牛才能做到的。我觉得学院应该在这方面下点功夫,给大家一些信心,我想这会改变很多人的学习兴趣和热情。

《一个程序猿的生命周期》-2.城市校园生活

  这个怎么感觉是人物传记啊,2333。不过结尾的一句不错  有时候人无法改变自己,可能是因为对现实还抱有幻想或内心对自己的恐惧。

灵感之源

  从前面看作者应该是个大牛级别的人,不过我感觉自己做不到这样。我知道自己的性格就有点“淡”,对什么事最多也只是喜欢,谈不到真正的热爱。比如我挺喜欢编程,但我做不到把全部精力都投入其中。兴致来了,我可能会连续几周熬夜码代码,但没兴致,就会将其“弃之不理”。

  不过我觉得自己还是很适合做一个程序员的,我喜欢学新的知识,也愿意花时间去动手做,而且挺注意代码质量的。就我个人而言,我也挺喜欢不断的换环境这种事,作者说的  跳槽是加薪的最佳办法  真是深得我心啊。

对程序员职业的一些建议

  这篇文章讲的感觉对以后的选择其实更实际点。对于编程这个职业,我不能说是非常的热爱,只是相对其他职业而言我更喜欢编程,所以我虽然会喜欢学习新技术但并不会刻意的去追求,如果接触到,需要用到才会去学。而对于工作打算,其实我更想要去创业的小公司,不过作者说的对,应该先去大公司学习一些规范的、成熟的工作习惯和思维方式,然后再去创业公司更合适。

  至于做技术没前途这个问题,其实我并不太感兴趣,我并没有渴望太过远大的理想,技术对我来说可能更多的是一种生活技能与兴趣。

  其余待加。

 

二.代码审查

 1.代码解读

  程富瑞同学的代码我看了一下,有种C和Java结合的感觉。所以的东西都放在了一个类里,而且代码的实现使用了很多逻辑符号,非常像C。不过各个功能还是封装成了一个个方法,而且数据结构也封装了,这点就像是Java。

  主要数据结构是:struct station和struct subLine,分别记录站点和线路的信息。

  主要方法主要是以下几个:

  readFile()  --  读取文件

  getLine()  --  根据线路名返回一个subLine

  printLine()  --  根据subLine参数输出线路上所有站点

  findTrailB()  --  求-b的最短路线

  findTrailC()  --  求-c的最短路线

  其他都是在这些方法实现时调用的小方法了。

2. 测试展示

(1)subway.exe

(2)subway.exe -b station1 station2

(3)subway.exe -c station1 station2

3. 代码复审检查表

General

 

Does the code work? Does it perform its intended function, the logic is correct etc.

把三个要求subway.exe , subway.exe -b station1 station2, subway.exe -c station1 station2 都测试了一下,可以正常运行。

Is all the code easily understood?

通过函数名能够大致了解函数的功能,不过没有注释,看起来不太方便。

Does it conform to your agreed coding conventions? These will usually cover location of braces, variable and function names, line length, indentations, formatting, and comments.

格式大都是VS自动排版的,不过与我不同的是,我喜欢在if-else后面都加上大括号,即使只有一条语句。

Is there any redundant or duplicate code?

代码写的比较省,没有多余的代码。

Is the code as modular as possible?

Yes

Can any global variables be replaced?

程序的功能都封装到一个类中了,没太用全局变量。

Is there any commented out code?

No

Do loops have a set length and correct termination conditions?

Yes

Can any of the code be replaced with library functions?

C++的库函数其实功能很少,大多还是要靠自己去实现,所以这里没有能被替换的功能。

Can any logging or debugging code be removed?

No

Security

Are all data inputs checked (for the correct type, length, format, and range) and encoded?

Yes

Where third-party utilities are used, are returning errors being caught?

Yes

Are output values checked and encoded?

No,这个输出我的程序也没检查

Are invalid parameter values handled?

Yes,无效参数和我的程序一样输出错误提示

Documentation

Do comments exist and describe the intent of the code?

Yes

Are all functions commented?

Yes

Is any unusual behavior or edge-case handling described?

No

Is the use and function of third-party libraries documented?

没有使用第三方包

Are data structures and units of measurement explained?

No

Is there any incomplete code? If so, should it be removed or flagged with a suitable marker like ‘TODO’?

没有不完整代码

Testing

Is the code testable? i.e. don’t add too many or hide dependencies, unable to initialize objects, test frameworks can use methods etc.

Yes

Do tests exist and are they comprehensive? i.e. has at least your agreed on code coverage.

不清楚

Do unit tests actually test that the code is performing the intended functionality?

Yes

Are arrays checked for ‘out-of-bound’ errors?

Yes

Could any test code be replaced with the use of an existing API?

不清楚

原文地址:https://www.cnblogs.com/14061216chen/p/5918325.html