How to write high quality code

博客围绕编码全流程给出质量提升建议。编码前要充分理解需求设计,多思考;编码中在有问题处加//TODO,逻辑判断处加注释;编码后先review代码,为backend部分写测试用例,测试所有执行路径,还可使用代码质量检查工具如findbugs。

编码前

  1. 真得理解了需求,设计。在把握需求设计得前提下动手,动手前编码前多思考”三分钟“

编码中

  1. 在有issue得地方,加上//TODO,以便清楚自己在过程中哪些地方不够确定
  2. 在有逻辑判断得地方加上注释,理好自己得思路(后期得修改容易理解程序逻辑)

编码后

  1. 自己动手测试前,再review自己得代码“三分钟’,以确定逻辑正确
  2. backend部分得code,来写一定得testcase,以便能够提早发现问题,不要等到同UI整合得时候再来发现问题。
  3. 对于其中有不同得执行路径得程序,要测试到所有得路径。不要抱‘那个路径不大会执行到‘得想法!
  4. 使用代码质量检查工具,例如findbugs.


网上收集相关:用正确方法来写出高质量软件的75条体会
                            
                            用findBugs来提高代码质量

Please download "Assignment3 to be completed.zip” file from the moodle . The task for this assignment is to complete all the methods in the classes provided. First task: Complete Point4f, Vector4f in GraphicsObjects Complete objects3D Cylinder & Sphere (10 % of your grade to make sure your work was done correctly from assignment 2) Second task: Run the program and you should a half human , that moves around in a circle facing the wrong way. The "a” key changes the animation Holding down your mouse allows you to rotate your view point, based on an Arcball, its only really useful dragging in 4 directions as the arcball is changing your perspective. Dragging to the corners will change the perspective and warp your model. To reset your view press "r” key and "e” key will put an example code object , the texture sphere . You are to complete the Human class and create a humanoid character ( 40% of your grade is based on you completing a human with 4 limbs. Please make the model more detailed than my example and ideally use the texture code form task 4 ) Remember for your project you can reuse this human class so the more detail, the better Third task: Animate the scene using the code provided and using the notes. The better the animation, the higher marks you will get . To make the animation work , examine the arm and leg code inside the human class. This LimbRotationvariable is used to sync up the movement. Use this code to complete the animation. You will need to edit both human.java and Mainwindow to make the animation correct in terms of how model rotates in the scene correctly. ( 30% of your grade is based on your animation quality , remember joints move only in certain angles ) Fourth task: With everything running, now I want you to customize your human with a texture. Example the texture code in the TexSphere class. Write a new class called TexCube , and use it to make a textured sign for you sign. You can put anything on the sign just to demonstrate your code works . Remember a cube can be scaled into a flat shape using GL11.glScalef . ( 10% of your grade is based on making this sign and with this code you can improve on your task 2 ) As always please write a comment in your code. ( 10% of your grade will be based on these comments) Please submit on moodle. Please zip the whole the eclipse project folder. (You will not be graded if the whole eclipse folder is not included)
11-08
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值