题目
CSE-110-OD25-27 9.1 Lesson and Knowledge Check - Study Hall Video Episode: 17
单项选择题
What is a best practice to follow when writing clean code?
选项
A.Each method in a program should accomplish at least two tasks.
B.There should be no spaces between the math operators and the variables used in each calculation.
C.There should be one common indentation for a class, a method, a loop, and a decision.
D.The names of variables should be noun-like, and the names of methods should be verb-like.
查看解析
标准答案
Please login to view
思路分析
Question: What is a best practice to follow when writing clean code?
Option 1: 'Each method in a program should accomplish at least two tasks.' Dos and don'ts of clean code emphasize clarity and single responsibility. This statement runs counter to the principle of keeping methods focused on a single task to improve readability and maintainability. Suggesting a minimum of two tasks can encourage unnecessarily large or multi-purpose methods.......Login to view full explanation登录即可查看完整答案
我们收录了全球超50000道考试原题与详细解析,现在登录,立即获得答案。
类似问题
Which of the following is NOT a proper naming convention? i. CourseCodeii. Crs_Codeiii. Course_Codeiv. Course Code
What is the difference between Snake Case and Kebab Case?
In column naming, some programs do not allow spaces between words. What kind of case is created where spaces are removed and every new word has a capital letter?
For a function with a parameter that is a list of test scores, which of these parameter names would be the best choice?
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!