bad

Clean Code第三章<函数>

good

Clean Code第三章<函数>

Clean Code第三章<函数>

2.函数只做一件事

Clean Code第三章<函数>

如果做了多件事,要在方法名里体现出来

Clean Code第三章<函数>

 

 

 

3.每个函数一个抽象层级

Clean Code第三章<函数>

 4.函数名可以长一些,比长注释好

Clean Code第三章<函数>

5.方法参数不要有bool值

Clean Code第三章<函数>

6.方法参数大于两个,考虑把其中的参数封装为对象

Clean Code第三章<函数>

 

相关文章:

  • 2021-12-17
  • 2021-04-18
  • 2022-01-30
  • 2022-03-05
  • 2021-08-20
猜你喜欢
  • 2021-12-22
  • 2021-12-12
  • 2021-05-14
  • 2021-05-17
  • 2021-10-27
  • 2022-01-04
相关资源
相似解决方案