题目
题目

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道考试原题与详细解析,现在登录,立即获得答案。

更多留学生实用工具

加入我们,立即解锁 海量真题独家解析,让复习快人一步!