我为什么将python作为第二语言

首先,不可否认的是,对于编程入门来说,Python确实是一种非常好的语言。

[En]

First of all, there is no denying that python is indeed a very good language for getting started with programming.

与其他静态语言不同,它在编程前需要考虑所有变量(函数输入和输出参数)类型等,而且语法比较容易理解,而且有很多有用的第三方库。

[En]

Unlike other static languages, it needs to consider all variables (function input and output parameters) types and so on before programming, and the syntax is relatively easy to understand, and there are many useful third-party libraries.

正是因为我学会了Python,我才开始着手编程。我在学校的时候也学过Java和c语言,但我一点兴趣都没有。)

[En]

It was because I learned python that I began to get started with programming. I also learned java and c when I was at school, but I had no interest at all. )

当我有两三年的工作经验时,我开始转学成为第二语言–蟒蛇。

[En]

When I had two or three years of work experience, I began to transfer to go as a second language, python.

主要原因是:

[En]

The main reasons are:

一、python是动态语言。不需要事先知道变量类型,解释器在运行时会自动判断。

这对程序员很方便,但对维护人员和其他服务调用者非常不友好。因为我不知道变量的类型。

[En]

This is convenient for programmers, but very unfriendly to maintainers and other service callers. Because I don’t know the type of variable.

一旦类型不正确,很容易导致程序崩溃。

[En]

Once the type is incorrect, it is easy to cause the program to crash.

例如:

[En]

For example:

def test(a):

b = a.get(“b”)

任何研究过蟒蛇的人都知道,a应该是一种词典。如果它是字符串类型,且字符串没有GET方法,则会报告错误。

[En]

Anyone who has studied python knows that a should be a dict. If it is of type str and str has no get method, an error will be reported.

因此,编写Python很酷,但维护起来却很累。

[En]

So it’s cool to write python, but it’s tiring to maintain.

二、编程速度快,从而缺少设计和构思。

这是一种很容易养成的坏习惯。

[En]

This is a bad habit that python programmers can easily develop.

一旦得到要求,就开始编程,同时编写和更改。很快,需求就会完成。

[En]

Start programming as soon as you get the requirements, writing and changing at the same time. Soon the demand will be completed.

对于简单的要求,这提高了编程效率。

[En]

For simple requirements, this improves programming efficiency.

但对于需要不断修改的后续要求来说,这是一场灾难。

[En]

But it is a disaster for subsequent requirements that need to be constantly modified.

它说,如果你发现一个糟糕的设计,你必须重新设计和重写它。

[En]

It says that if you find a bad design somewhere, you have to redesign and rewrite it.

而且由于代码编写非常随意,维护起来也不方便。

[En]

And because the code is written very casually, it is not convenient to maintain.

简单地说,为了提高效率,它降低了可伸缩性和可维护性。

[En]

To put it simply, it reduces scalability and maintainability for the sake of efficiency.

就我个人而言,这就是许多大型项目不使用Python的原因。

[En]

Personally, this is why many large projects do not use python.

当然,这些问题是程序员自己的问题,如果程序员以前学习过其他静态语言的话。

[En]

Of course, these problems are the programmers’ own problems, if the programmers have learned other static languages before.

或者他们自己的编程技能都很深厚。这些问题是可以避免的。

[En]

Or their own programming skills are very deep. These problems can be avoided.

三、代码运行效率相对其他静态语言要低

这就是动态语言的局限性。

[En]

This is the limitation of dynamic language.

拿python和go以为例

python就像是实时翻译,而go则是翻译好的稿子。

在运行PYTHON时,我们需要将中文实时翻译成英文。再读一遍。

[En]

When running python, we need to translate Chinese into English in real time. Read it again.

运行围棋时,只需按照脚本上的英文阅读即可。

[En]

When running go, you just need to read it according to the English on the script.

按照剧本阅读一定比先翻译要快。

[En]

It must be faster to read according to the script than to translate it first.

在许多情况下,我们更关心程序的速度,这使得Python很难派上用场。

[En]

In many cases, we care more about the speed of the program, which makes it difficult for python to come in handy.

四、养成对第三方库的依赖

在使用了很长时间后,你会习惯于偷懒,因为Python有很多三方库,你想直接使用它们。

[En]

After using python for a long time, you will get used to being lazy, because python has a lot of three-party libraries, and you want to use them directly.

事实上,这样做没有问题。但前提是你对第三方库非常熟悉,否则如果第三方库出现问题就很难定位。

[En]

In fact, there is no problem with doing so. But the premise is that you are very familiar with the third-party library, otherwise it will be difficult to locate if there is a problem with the third-party library.

避免构建自己的轮子是正确的,但深入了解三方库有助于以后的维护和提高自己的编程水平。

[En]

It’s right to avoid building your own wheels, but an in-depth understanding of the tripartite library is beneficial to later maintenance and the improvement of your own programming level.

综上所述,Python由于其简单的语法和丰富的三方库,大大提高了程序员的工作效率。

[En]

Summary, python because of its simple syntax and rich three-party library, greatly improve the efficiency of programmers.

但程序员也很容易养成先编程后思考的坏习惯。

[En]

But it is also easy for programmers to develop the bad habit of programming first and thinking later.

丰富的标准库和三方库屏蔽了底层细节的实现,解放了程序员。

[En]

The rich standard library and tripartite library shield the implementation of the underlying details and liberate the programmers.

但数据库、网络、操作系统等知识是优秀程序员的必备技能。

[En]

But knowledge of database, network, operating system and so on are necessary skills for excellent programmers.

python降低编程门槛的同时,也拉低了程序员的编程素质。(可能说的有点过了)

(没有任何贬低的意思)个人感觉,其他静态语言的编程人员的编程素质普遍比只会动态语言的编程人员更高一些。

由于动态语言往往会掩盖很多实现细节以提高效率,这会导致该语言的程序员不注重细节,更容易出现问题。

[En]

Because dynamic languages tend to mask a lot of implementation details to improve efficiency, this will cause the programmers of the language not to pay attention to the details and are more prone to problems.

在掌握Python的同时,至少要学习一门静态语言,编程之路才会走得更远。

[En]

While mastering python, to learn at least one static language, the road to programming will go further.

在学习其他静态语言时,您会遇到很多Python没有的问题。因为其他语言不一定有相应的三元库。

[En]

When learning other static languages, you will encounter a lot of problems that python does not have. Because other languages do not necessarily have corresponding tripartite libraries.

你可能需要自己造轮子,这可能很烦人,但这对你自己的成长很有帮助。

[En]

You may need to build your own wheels, which can be annoying, but it’s helpful for your own growth.

以上内容仅代表个人观点。如果你们有不同意见,请友好地交换意见。

[En]

The above are just personal views. If you have different opinions, please exchange them amicably.

Original: https://www.cnblogs.com/lgh344902118/p/15810484.html
Author: 菲菲菲菲菲常新的新手
Title: 我为什么将python作为第二语言

原创文章受到原创版权保护。转载请注明出处:https://www.johngo689.com/6555/

转载文章受原作者版权保护。转载请注明原作者出处!

(0)

大家都在看

发表回复

登录后才能评论
免费咨询
免费咨询
扫码关注
扫码关注
联系站长

站长Johngo!

大数据和算法重度研究者!

持续产出大数据、算法、LeetCode干货,以及业界好资源!

2022012703491714

微信来撩,免费咨询:xiaozhu_tec

分享本页
返回顶部