当前位置:网站首页>1141_ SiCp learning notes_ Functions abstracted as black boxes
1141_ SiCp learning notes_ Functions abstracted as black boxes
2022-07-07 07:31:00 【grey_ csdn】
All learning summary :GitHub - GreyZhang/g_SICP: learn SICP and hack lisp.
First of all, notice , The previous repeated process of solving the square root is actually a recursive process . The design of a program depends on its own function , In the process of execution, we need to constantly make self Owen calls . Actually , This way makes me feel a little bit like feedback adjustment . Another point is that the process of solving this square root is actually a combination of a series of functions , This is also the same description as the overall to local design I thought of earlier .
Here is a clarification that is of great reference significance , Several functions are used to calculate the square root in front of the design . The design of software is actually to divide a function into several . however , The key point of this decomposition strategy is not to split a function into different functions , After all, if you force a split , A function can be split into ten lines , A large program can be divided into several functions . Such significance is not great . The premise of splitting should be that the disassembled function can become an independent module that can be reused constantly . Another point is that , The design application of this black box is likely to be used in the overall description stage considered in the previous learning process . At this stage , We can assume the existence of some functions without thinking too much about the way they are implemented . The design of function modules can hide details , This also brings another point of thinking : If you use C Language for similar design , In fact, try to avoid using global variables to interact between different functions . Or say , Try not to use the same variable for different functions , Otherwise, the coupling of functions will be enhanced . It is not easy to consider some function calls as black boxes in the understanding of software .
Although the title of this part is called local name , But it has nothing to do with local variables . Here we mainly talk about the relationship between formal parameters and arguments , Rather than the expression of local quantities . And formal parameters , Only when there is corresponding information bound with it can a scope play its corresponding role .
The initial program implementation was a set of functions , There may be conflict problems with commonly used functions . such as , A good enough method may be used in many ways , But the content of judgment is different . such , There may be conflicts when designing different software functions . And the above gives a non conflicting way , That is to make these contents into sub functions of functions . such , Its scope is also limited to the interior of a function .
further , Because each function uses the same parameters . Therefore, the design here can directly omit a parameter , Use the same parameters directly . This design is indeed a lot simpler , But I want to come here C It may still be difficult to implement in the design of language . however , Either of the latter two implementations , In fact, it further hides the details of the design , Make the whole function design more black box .
边栏推荐
- Freeswitch dials extension number source code tracking
- Advanced practice of C language (high level) pointer
- Chinese and English instructions prosci LAG-3 recombinant protein
- Convolutional neural network -- understanding of pooling
- Explain Bleu in machine translation task in detail
- Non empty verification of collection in SQL
- 07_ Handout on the essence and practical skills of text measurement and geometric transformation
- js小练习----分时提醒问候、表单密码显示隐藏效果、文本框焦点事件、关闭广告
- 软件验收测试
- 身边35岁程序员如何建立起技术护城河?
猜你喜欢
Fast quantitative, abbkine protein quantitative kit BCA method is coming!
Model application of time series analysis - stock price prediction
The annual salary of general test is 15W, and the annual salary of test and development is 30w+. What is the difference between the two?
Robot technology innovation and practice old version outline
I failed in the postgraduate entrance examination and couldn't get into the big factory. I feel like it's over
Flexible layout (I)
Advanced practice of C language (high level) pointer
Bi she - college student part-time platform system based on SSM
1089: highest order of factorial
RuntimeError: CUDA error: CUBLAS_ STATUS_ ALLOC_ Failed when calling `cublascreate (handle) `problem solving
随机推荐
Cloud backup project
毕设-基于SSM大学生兼职平台系统
计算机服务中缺失MySQL服务
Nesting and splitting of components
FPGA course: application scenario of jesd204b (dry goods sharing)
Sqlmap tutorial (IV) practical skills three: bypass the firewall
sql中对集合进行非空校验
Stack Title: nesting depth of valid parentheses
记一个并发规则验证实现
Wechat applet full stack development practice Chapter 3 Introduction and use of APIs commonly used in wechat applet development -- 3.9 introduction to network interface (IX) extending the request3 met
Communication between non parent and child components
3、 High quality programming and performance tuning practical youth training camp notes
Fullgc problem analysis and solution summary
Outlier detection technology of time series data
js小练习
Introduction to abnova's in vitro mRNA transcription workflow and capping method
聊聊异步编程的 7 种实现方式
Kuboard can't send email and nail alarm problem is solved
FullGC问题分析及解决办法总结
After 95, the CV engineer posted the payroll and made up this. It's really fragrant