辩论opener_您应该学习辩论的第一门编程语言

辩论opener

JS v Python… the final showdown

JS v Python…最后的决战

At this point there can be no doubt if you are in the tech world you have heard of both of these popular languages. Maybe if you are just starting out you are wondering what the differences are and which one you should learn. My programming journey started three years ago and I remember searching extensively to find which language I should learn first. I was interesting in data analysis and so my choices were R or Python. I chose Python and have written it daily ever since. Your choice may not be so clear. There are hundreds of programming languages to choose from. So today I plan to answer the age-old question of: “What programming language should I learn first? (in 2020)”

在这一点上,毫无疑问,如果您在科技界,您已经听说过这两种流行语言。 也许如果您刚刚开始,您会想知道这些区别是什么,应该学习哪些区别。 我的编程之旅始于三年前,我记得进行了广泛的搜索以查找应该首先学习哪种语言。 我对数据分析很感兴趣,因此我选择了R或Python。 从那时起,我选择了Python,并且每天都在编写它。 您的选择可能不太清楚。 有数百种编程语言可供选择。 因此,今天我计划回答一个古老的问题:“我应该首先学习哪种编程语言? (2020年)”

Caveat: the first for reference here does not refer to existing programmers looking for transitions, but new programmers who have never written code before.

警告:这里首先提供参考的并不是针对寻求过渡的现有程序员,而是从未有过编写代码的程序员。

设置舞台 (Set the Stage)

Both JavaScript and Python offer a wide range of features and have extensive, amazing communities behind them. We are going to delve into the technical and professional aspects of both languages while avoiding some of lower-level technical details. In doing so, I hope to paint a picture of which language you should choose based on your preferences and personality. We will compare these languages on only two key aspects: learning curve and utility/use-cases.

JavaScript和Python都提供了广泛的功能,并在其背后具有广泛而令人惊叹的社区。 我们将深入研究这两种语言的技术和专业方面,同时避免一些较低级别的技术细节。 在此过程中,我希望根据自己的喜好和个性来画出应该选择哪种语言的图片。 我们将仅在两个关键方面比较这些语言:学习曲线和实用程序/用例。

1.学习曲线 (1. Learning Curve)

JS and Python both have low learning curves and are quite easy to pick up on. Both are dynamically typed which helps beginners tremendously. Python is currently embracing type hints, but these are not enforced and runtime. Similarly, JS has a language subset called TypeScript which enforces types on all objects but JS itself does not. Speaking of, both languages follow OOP principles which is another plus for learning since objects are a great way to relate abstract coding structures to real-life structures.

JS和Python的学习曲线都很低,并且很容易掌握。 两者都是动态键入的,可极大帮助初学者。 Python当前正在接受类型提示,但是这些提示未得到强制执行且无法运行。 同样,JS具有一个名为TypeScript的语言子集,该子集可对所有对象强制执行类型,但是JS本身不会。 可以说,这两种语言都遵循OOP原则,这是学习的另一个优点,因为对象是将抽象编码结构与实际结构联系起来的一种好方法。

One downside to Python is that it requires installation and Python versions change relatively frequently. Managing Python versions is a known headache for any Python dev, but there are many packages out there to help combat this issue including conda, poetry, and virtualenv. In order to run Python scripts you either need to utilize Jupyter Notebooks (which require installation) or utilize a terminal and code editor to write code (yes these could be the same via vim/nano). The Anaconda installation does install VS Code, Jupyter Notebook, Python all at once for users and is available on all platforms.

Python的缺点之一是它需要安装并且Python版本相对频繁地更改。 对于任何Python开发人员来说,管理Python版本都是众所周知的难题,但是有很多软件包可以帮助解决此问题,包括conda,诗歌和virtualenv。 为了运行Python脚本,您需要利用Jupyter Notebooks(需要安装)或利用终端和代码编辑器来编写代码(是的,通过vim / nano可以是相同的)。 Anaconda安装确实为用户一次安装了VS Code,Jupyter Notebook和Python,并且在所有平台上都可用。

JS, on the other hand, can be written directly in your browser simply by navigating to the Chrome Developer Tools. This makes it very user friendly since you can actually just code in your browser and see the changes directly happen on a web page. No installation required. This principle does break down once you start installing node packages and using frontend frameworks, but for Vanilla JS, it couldn’t be easier to get started.

另一方面,只需导航到Chrome开发者工具,即可直接在浏览器中编写JS。 这使它非常用户友好,因为您实际上可以只在浏览器中编写代码并直接在网页上查看更改。 无需安装。 一旦您开始安装节点软件包并使用前端框架,该原理便会失效,但是对于Vanilla JS来说,上手起来并不容易。

As far as syntax goes, both languages are simple to understand and get used to and any code editor provides great support for both. Arguments could be made for Python over JS on the syntax front, but I think they are simply different and that, with editor support, neither would provide a large hinderance to getting starting. On second thought, I would select Python here due to ignoring curly braces and no semi-colons despite its whitespace issues. Especially considering that advanced frontend frameworks like the popular React library or Angular utilize ES6 syntax which can be quite confusing at times.

就语法而言,这两种语言都易于理解和习惯,任何代码编辑器都为这两种语言提供了强大的支持。 可以在语法方面针对JS之上的Python进行争论,但是我认为它们完全不同,并且在编辑器的支持下,这两者都不会为入门提供很大的障碍。 再次考虑,我会在这里选择Python,因为它忽略了花括号并且尽管存在空格问题也没有分号。 特别是考虑到像流行的React库或Angular这样的高级前端框架都使用了ES6语法,这有时可能会造成混乱。

2.实用程序/用例 (2. Utility / Use Cases)

The use cases for these languages are where they really differ. This also bleads into job prospects. Python is excellent for data analysis, data engineering, data science, one-off scripts, automation, machine learning, and backend web development. Javascript is excellent at nearly everything on the web from frontend styling and animation to backend frameworks and interacting with databases.

这些语言的用例是它们真正不同的地方。 这也导致了就业前景。 Python非常适合用于数据分析,数据工程,数据科学,一次性脚本,自动化,机器学习和后端Web开发。 从前端样式和动画到后端框架以及与数据库的交互,Java几乎在Web上的所有方面都很出色。

The simplest way I can explain the difference here is this: Python works many places, JS works on the web only. If you want to build on the web only, the choice is easy: JS. If you want to build small games, desktop apps, software, or do data related tasks, choose Python.

我可以在这里解释差异的最简单方法是:Python在很多地方都可以使用,JS在网络上可以使用。 如果只想在Web上构建,则选择很简单:JS。 如果要构建小型游戏,桌面应用程序,软件或执行与数据相关的任务,请选择Python。

Interestingly, Python can do some of the things JS can do regarding web development backend. In fact, Python’s two most popular web frameworks Django and Flask run many popular web backends. JS has its own backend frameworks including Express.

有趣的是,Python可以完成JS在Web开发后端方面可以做的一些事情。 实际上,Python的两个最受欢迎的Web框架Django和Flask运行着许多受欢迎的Web后端。 JS有自己的后端框架,包括Express。

结论 (Conclusion)

In summary, I would recommend JS if you are interesting in building websites (either frontend or backend) and Python if you are interested in data, general-purpose programming, and some web development.

总而言之,如果您对构建网站(前端或后端)感兴趣,我会推荐JS,如果对数据,通用编程和某些Web开发感兴趣的话,我会推荐Python。

If you are feeling adventurous you should learn BOTH. My current preferred stack is to use Python for all of my data related tasks and database interactions and JavaScript to build my website. I use Python for software that I build and share as well as analysis and then, almost always, end up transitioning this software/analysis into an API (which is just a website that returns data at given URLs instead of web pages). I then combine this API with a JS frontend framework like React (or my current favorite, VueJS). I found my Django/Flask websites lacking core functionality utlizing only templates and Bootstrap styling. And now, having learned JS, can say I am very much enjoying being a full-stack developer and being able to work on a project from start to finish, end-to-end.

如果您喜欢冒险,则应学习两者 我当前的首选堆栈是使用Python来完成所有与数据相关的任务,数据库交互以及使用JavaScript来构建我的网站。 我使用Python进行构建和共享以及分析的软件,然后几乎总是将这种软件/分析转换为API(这是一个以给定URL而不是网页返回数据的网站)。 然后,我将此API与JS前端框架(例如React)(或我目前最喜欢的VueJS )结合使用。 我发现我的Django / Flask网站缺乏仅使用模板和Bootstrap样式的核心功能。 现在,已经学习了JS,可以说我非常喜欢成为一名全栈开发人员,并且能够从头到尾,从头到尾地从事一个项目。

If you’ve made it this far I thank you!

如果您已经做到了,那么谢谢!

Have a great day and be kind to yourself and others!

祝您有美好的一天,并对自己和他人友善!

翻译自: https://medium.com/the-innovation/the-first-programming-language-you-should-learn-a-debate-93611b06acd2

辩论opener

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值