翻译于 2017/05/01 13:36
2 人 顶 此译文
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.
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.
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.
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.
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.
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.
一旦你了解了该语言,就可以利用上这个平台。Python 以 PyPI (读作 Pie-Pie,可以从这里在线进行了解)为其后盾, 这是一个拥有超过 85,000 个 Python 模块和脚本的资源库,你拿过来就立马可以使用。这些模块向你的本地 Python 环境分发已经预先打包好的功能,可以用来解决各种诸如数据库处理,计算机视觉实现,像维度分析这样的高级数据分析的执行,或者是构建 REST 风格的 web 服务这些问题。
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.
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.
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.
Python 可以跨平台运行,并且已经开放源代码超过20年的时间了,如果你需要代码能同时在Linux,Windows 以及 macOS 上跑起来,Python 就能满足要求。此外,有数十年的修修补补以及不断完善做后盾,可以确保你能够随心所欲地运行自己的代码。
有一些Python同其它编程语言集成在一起的稳定实现。
CPython, 同 C 集成的版本。
Jython, 同 Java 集成的Python版本。
IronPython, 被设计用来兼容 .Net 和 C#。
PyObjc, ObjectiveC 工具下的 Python 写法。
RubyPython, 同 Ruby 集成的 Python 版本。
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.