当前位置:网站首页>More than 100 lines should be split into functions
More than 100 lines should be split into functions
2022-07-27 21:57:00 【Dream and wake up, happy and carefree】
In fact, at the beginning, most of the programs we compiled were only dozens of lines , There is no need to disassemble at this time .
Before you take it apart , The more lines you can accept , The stronger the overall grasp ability of a function .
But it's better to go too far , When the number of lines rises to 100 Row or so , You should consider disassembling , Because at this time, what you are considering is not your overall grasp ability .
One side , It needs to be maintained later , Function write too large , There will be entanglement between them , Lead to bad modification .
On the other hand , you debug When , Taking functions apart is also conducive to finding the focus of the problem .
summary :100 OK, let's take it apart , I'll do it later ( In fact, it has been done now , Last time, the greedy snake 300 That's ok ,7 A function , There are also some big problems, such as calculators , It's also 300 Line a few functions to disassemble for him , Including critical path , All are )
边栏推荐
- LVS+Keepalived高可用群集
- Commercial delay of self-developed 5g chip? Apple iPhone will adopt Qualcomm 5g chip in the next four years
- 纳微半导体65W 氮化镓(GaN)方案获小米10 Pro充电器采用
- Recursion / backtracking (Part 1)
- 2021-11-05 understand main method syntax, code block and final keyword
- For 3nm and below processes, ASML new generation EUV lithography machine exposure
- Samsung's most advanced EUV production line has been put into operation: the 7Nm capacity this year will be three times that of last year
- 高并发遇到死锁了,如何搞?
- It seems to be a bug of thread pool, but I think the source code design is unreasonable.
- The design idea of relational database is obvious to you in 20 pictures
猜你喜欢

怎么还有人问 MySQL 是如何归档数据的呢?

B站崩了,那晚负责修复的开发人员做了什么?

关系型数据库的设计思想,20张图给你看的明明白白

IDEA连接MySQL数据库并执行SQL查询操作

为什么要使用MQ消息中间件?这几个问题必须拿下

@Can component be used on the same class as @bean?

Is log4j vulnerability still widespread?

CBAM learning notes

University of Tilburg, Federal University of the Netherlands | neural data to text generation based on small datasets: comparing the added value of two semi supervised learning approvals on top of a l
Excalidraw: an easy-to-use online, free "hand drawn" virtual whiteboard tool
随机推荐
零钱通项目(两个版本)含思路详解
Ziguang zhanrui: dozens of 5g terminals based on chunteng 510 will be commercially available in 2020
看起来是线程池的BUG,但是我认为是源码设计不合理。
Finish learning redis cluster solution at one go
一文读懂Plato Farm的ePLATO,以及其高溢价缘由
Station B collapsed. What did the developer responsible for the repair do that night?
DAY_ 4. Operation -- judge whether there is a certain data in the array -- realize array mapping (enlarge by 10 times) -- insert the array in sequence (modify bugs) -- realize array de duplication
Microsoft store can't download apps, vs2019 can't download plug-ins solution
Custom recycleview delete & move animation
紫光展锐:2020年将有数十款基于春藤510的5G终端商用
为什么服务端程序都需要先 listen 一下
Enumeration and annotation
Log4j vulnerability is still widespread and continues to cause impact
美国将禁止所有中国企业采购美国芯片?特朗普这样回应
2019q4 memory manufacturers' revenue ranking: Samsung fell 5%, only SK Hynix and micron maintained growth
In addition to "adding machines", in fact, your micro service can be optimized like this
Under the epidemic, the mobile phone supply chain and offline channels are blocked! Sales plummeted and inventory was serious!
How to realize a good knowledge management system?
微软商店无法下载应用,VS2019无法下载插件问题解决方案
美司法部增加针对华为的指控,包括窃取商业秘密等16项新罪名