编程名词辨析(5×10’)
source link: https://greyli.com/analysis-of-programming-terms-5x10/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
编程名词辨析(5×10’)
在和很多同学的交流中,发现有些编程词语被误用了。今天我们来辨析一下。
我简化了大部分解释,如果需要了解更多,请点链接。如果发现有错,请指正。
包(package)和模块(module)
包:一个包含__init__.py文件的文件夹就是一个包,这个文件夹里可以放多个Python模块。比如:
模块:一个Python文件(.py)就是一个模块。
What’s the difference between a Python module and a Python package?
插件(plugin)和扩展(extension)
在Flask里,插件和扩展没有具体的区别,都指代增强Flask功能的Python包,但通常称作扩展。
参数(parameter)和参数(argument)
参数(形参):函数所期望你传入的参数(即name)
参数(实参):传给函数的实际的参数(即‘kitty’)
What’s the difference between an argument and a parameter?
函数(function)和方法(method)
函数:为了便于进行管理和重用而包装起来的代码块。
方法:在类中定义的函数是方法。
Difference between functions and methods in Python
表达式(expression)和语句(statement)
表达式:能被打印和赋值的是表达式。比如:
语句:任何一行(或多行)Python代码就是语句(包括表达式),比如:
What is the difference between an expression and a statement in Python?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK