7 个你现在就该学习 Python 的理由 已翻译 100%

oschina 投递于 2017/04/30 11:39 (共 9 段, 翻译完成于 05-02)
阅读 8691
收藏 45
5
加载中

Python is a favorite among many developers for its strong emphasis on readability and efficiency, especially when compared to other languages like Java, PHP, and C++.

Sure, it’s old, but it’s 1980s old — not Cobol or Fortran old. Besides, if something works, why change it (especially when there are so many ways to improve it)?

Actually, depending on how you view it, longevity is a good thing in itself — a sign of stability and reliability.

已有 1 人翻译此段
我来翻译

If you’re like many people who first started out with Java, C, or Perl, the learning curve for Python is practically nonexistent. But the fact that it’s easy to learn is also the reason why some people don’t see Python as a necessary programming skill.

I’ll be honest with you, my love of Python didn’t really develop until a few years ago. It took a long career of painful lessons to appreciate everything this language and platform have to offer. My goal with this short post is to save you the same pain and convince you why Python is something you need to know.

已有 1 人翻译此段
我来翻译

1. Python Is Easy to Learn

Well, at least it’s “easier” compared to many of the other programming languages available to you. There isn’t a lot of ceremony to Python’s syntax, which makes it readable even when you’re not a Python expert. My experience is that learning and teaching Python through examples is easier than approaching, say, Ruby or Perl the same way, since the syntax of Python has far fewer rules and special cases. The focus isn’t on language intricacies; it’s on what you want to accomplish with your code.

已有 1 人翻译此段
我来翻译

3. Python Lets You Build More Functions With Less Code

Python is a quick study for anyone. With practice, you can easily build a rudimentary game in two days, tops (and that’s after knowing absolutely nothing about programming).

Another factor that makes Python an attractive programming language for novices is its readability and efficiency.

已有 1 人翻译此段
我来翻译

4. Python Is a Versatile Language and Platform

Python will be 28 years old in 2017. Even though that’s older than many of my readers, it remains highly relevant because it can be applied to pretty much any software development or operations scenario you can find today. Managing local or cloud infrastructure? Python applies. Developing websites? Yep, it applies there too. Need to work against a SQL database? It does that. Need a custom function for Hive or Pig? Covered. Just building a small tool for yourself? Python’s simplicity makes it a great choice. Need a language that supports the rigor of object-oriented design? Python’s features make it relevant here, too. In short, investing a little effort into learning Python will give you skills that apply across a wide range of job roles.

已有 1 人翻译此段
我来翻译

5. Python Has One of the Most Mature Package Libraries 

Once you know the language, you can leverage the platform. Python is backed by PyPI (pronounced Pie-Pie and perusable online here), which is a repository of more than 85,000 Python modules and scripts that you can use immediately. These modules deliver prepackaged functionality to your local Python environment and solve problems as diverse as working with databases, implementing computer vision, executing advanced data analytics such as sentiment analysis, or building RESTful web services.

已有 1 人翻译此段
我来翻译

6. Python Is a Commonly Used Language in Data Science

Whatever job you’re reaching for, data will be a part of it. IT ops, software development, marketing, etc. — they’re all drowning in data and thirsting for wisdom. Soon data analytics skills will be as necessary as coding skills, and Python has a strong presence in both areas. Next to the language R, Python is the most used language in modern data science; in fact, Python job postings outnumber R postings in the data science arena. The skills you develop learning Python will transfer directly to building these analytics skills.

已有 1 人翻译此段
我来翻译

7. Python Is Cross-Platform and Open Source

Python’s been running cross-platform and open source for more than 20 years. If you need code that works on Linux, Windows, and MacOS, Python provides. Moreover, it’s backed by decades of bug-squashing and kink-straightening to ensure that your code works as intended wherever you run it.

8. Python Is Flexible

There are several robust Python implementations integrated with other programming languages.

  • CPython, a version with C.

  • Jython, or Python integrated with Java.

  • IronPython, which is designed for compatibility with .NET and C#.

  • PyObjc, or Python written with ObjectiveC toolkits.

  • RubyPython, or Python combined with Ruby.

已有 1 人翻译此段
我来翻译

Conclusion

There aren’t a lot of languages that can offer the versatility and simplicity of Python; there are even fewer that can do so alongside decades of thought, effort, and community that has gone into Python. Whether you’re new to code or a script-spewing guru, Python is something you need to know.

已有 1 人翻译此段
我来翻译
本文中的所有译文仅用于学习和交流目的,转载请务必注明文章译者、出处、和本文链接。
我们的翻译工作遵照 CC 协议,如果我们的工作有侵犯到您的权益,请及时联系我们。
加载中

评论(21)

icoffin
icoffin
python,半天入不了门的程序员是不合格的。不过强制缩进太反人类了。不推荐用
开源中国首席顾问
开源中国首席顾问
感觉这是门超弱性语言,用来开发应该挺好的
osc_2271528
osc_2271528
python 跳起来吧
Zero__One
Zero__One
我觉得没有必要…
vingzhang
vingzhang

引用来自“ichynul”的评论

除非取消强行缩进

引用来自“Raymin”的评论

是啊!学 Python 多年,至今不知该如何破如下难题:
x = 1
y = 2
if x == 1:
x += 1
y += 2
print(x, y)
Python 应该有一个哪怕是可选的 end 关键字,就更完美了。

引用来自“xshrim”的评论

讨厌的就是end关键字,这种关键字让我感觉是上个世纪的语言,平白多打字。Python的强制缩进非常好,我现在写代码都强迫症了,必须满足编写规范才舒服。或许是你们自己被其他语言套上了枷锁而已。
如果空白被脱掉,python代码简直是噩梦
榕树下_
榕树下_
py + go = good
x
xshrim

引用来自“ichynul”的评论

除非取消强行缩进

引用来自“Raymin”的评论

是啊!学 Python 多年,至今不知该如何破如下难题:
x = 1
y = 2
if x == 1:
x += 1
y += 2
print(x, y)
Python 应该有一个哪怕是可选的 end 关键字,就更完美了。
讨厌的就是end关键字,这种关键字让我感觉是上个世纪的语言,平白多打字。Python的强制缩进非常好,我现在写代码都强迫症了,必须满足编写规范才舒服。或许是你们自己被其他语言套上了枷锁而已。
Raymin
Raymin

引用来自“ichynul”的评论

除非取消强行缩进
是啊!学 Python 多年,至今不知该如何破如下难题:
x = 1
y = 2
if x == 1:
x += 1
y += 2
print(x, y)
Python 应该有一个哪怕是可选的 end 关键字,就更完美了。
robortly
robortly
C#是世界最好的语言。
xaoyaoyaomm
xaoyaoyaomm
为什么没有Python是最好的语言😄
返回顶部
顶部