您应该在2020年首先学习哪种编程语言? ɐʌɐɾdıɹɔsɐʌɐɾ:ɹǝʍsuɐ

Most people’s journey toward learning to program starts with a single late-night Google search.

大多数人学习编程的旅程都是从一个深夜Google搜索开始的。

Usually it’s something like “Learn ______”

通常它类似于“学习______”

But how do they decide which language to search for?

但是,他们如何决定要搜索的语言呢?

“They always joke about Java on Silicon Valley. I guess I should learn that.”
“他们总是在硅谷开玩笑说Java。 我想我应该学那个。”

Or:

要么:

“Haskell. So hot right now. Haskell.”
哈斯克尔。 现在太热了。 哈斯克尔。”

Or:

要么:

“That Go gopher is just so gosh-darn cute.”
“那个地鼠真是太可爱了。”

And then there’s the rest of us. We’ll probably search for something like:

然后是我们其余的人。 我们可能会搜索类似的内容:

“Which programming language should I learn first?”
“我应该首先学习哪种编程语言?”

Few questions are so commonly asked that they get the full infographic treatment. But this is one of them:

很少有人问过这么普遍的问题,以至于他们得到完整的信息图表处理。 但这是其中之一:

Deciding on your first programming language can be a fun process — kind of like one of those “Which Quentin Tarantino character are you?” personality quizzes.

确定您的第一门编程语言可能是一个有趣的过程-有点像“您是哪个昆汀·塔伦蒂诺角色?”中的一个。 个性测验。

But before you run off to learn Ruby because you enjoyed playing with Play-Doh as a kid, let me remind you: the stakes are pretty high here.

但是在您因为小时候喜欢玩Play-Doh而开始学习Ruby之前,让我提醒您:这里的赌注相当高。

It will take you hundreds of hours of practice to become even remotely competent with your first programming language.

要想远程掌握第一门编程语言,将需要数百小时的练习时间。

So you should consider the following factors:

因此,您应该考虑以下因素:

  • the job market for the language

    语言的就业市场
  • the long term prospects for the language

    语言的长期前景
  • how easy the language is to learn

    语言学习起来有多容易
  • what projects you can build while you’re learning (and share with friends so you can stay motivated)

    您在学习时可以构建哪些项目(并与朋友分享,以便保持动力)

Every year brings new programming languages, and with them, new academic papers. And new web comics.

每年都会带来新的编程语言,并随之带来新的学术论文。 以及新的网络漫画。

Seriously. Check out this gem from last month:

说真的 看看上个月的这张宝石:

When it comes to choosing a first programming language, there’s no shortage of options. To narrow it down a bit, here are the most common Google searches related to learning programming, over the past 12 years:

在选择第一种编程语言时,不乏选择。 为了缩小范围,以下是过去12年中与学习编程相关的最常见的Google搜索:

Java has had its ups and downs.

Java经历了风风雨雨。

Python has gradually risen to become the most popular choice.

Python已逐渐成为最受欢迎的选择。

But tucked away below these is the Little Engine That Could, slowly choo-choo’ing up in popularity over the past few years. And that engine is JavaScript.

但是隐藏在这些之下的是“可能制造的小引擎”,在过去几年中逐渐流行起来。 该引擎是JavaScript。

Before I talk about these programming languages, let me clarify:

在讨论这些编程语言之前,让我澄清一下:

  • I’m not arguing that any one language is objectively better than any other

    我并不是说任何一种语言在客观上都比其他任何一种都要好
  • I agree that developers should eventually learn more than one language

    我同意开发人员最终应该学习多种语言
  • I’m arguing that first they should learn one language well. And — as you can probably guess from the upside down text in my headline — that language should be JavaScript.

    我在争辩说他们首先应该学习一种语言。 而且-正如您可能从标题中的上下颠倒文字中猜测的那样-该语言应为JavaScript。

Let’s kick things off by exploring how programming is currently taught in school.

让我们开始探索目前学校如何教授编程的事情。

计算机科学101 (Computer Science 101)

Universities have traditionally taught programming under the umbrella of computer science, which itself is often seen as an extension of mathematics, or tie-in to an electrical engineering degree.

传统上,大学在计算机科学的保护下教授编程,这本身通常被视为数学的扩展,或与电气工程学位紧密结合。

Of course, as you may have heard by now:

当然,如您现在所听到的:

“Computer science education cannot make anybody an expert programmer any more than studying brushes and pigment can make somebody an expert painter.” — Eric S. Raymond
“计算机科学教育不能使任何人成为专家程序员,而学习画笔和颜料可以使某人成为专家画家。” —埃里克·雷蒙德(Eric S. Raymond)

As of 2016, many universities still treat programming like it’s computer science, and computer science like it’s math.

截至2016年,许多大学仍将编程视为计算机科学,而将计算机科学视为数学。

As a result, many introductory programming courses focus on low-level-of-abstraction languages like C, or mathematically-focused languages like MATLAB.

因此,许多入门编程课程都将重点放在诸如C的低层次抽象语言或诸如MATLAB的以数学为重点的语言上。

And department chairs generally stay the course, pointing to annual programming language leaderboards like the TIOBE Index, or this one from the IEEE:

部门主席通常会继续学习,指向年度编程语言排行榜,例如TIOBE IndexIEEE的这一排行榜:

Most of these leaderboards look virtually identical to how they were 10 years ago.

这些排行榜中的大多数看上去几乎与10年前一样。

But change does happen. Even in academia.

但是改变的确发生了。 即使在学术界。

In 2014, Python overtook Java as a the most popular language of instruction at top US Computer Science programs.

2014年,Python 超过Java ,成为美国计算机科学顶级程序中最流行的指令语言。

And yet another change is bound to… eventually… happen.

然而,另一改变必将……最终……发生。

Because if you look at the languages actually used by the workforce, it paints a very different picture:

因为如果您查看劳动力实际使用的语言,它会描绘出截然不同的画面:

More than half of all developers use JavaScript. It’s vital to front-end web development and increasingly relevant for back-end development. And it’s rapidly expanding into areas like game development and the Internet of Things.

所有开发人员中超过一半使用JavaScript。 这对前端Web开发至关重要,并且对后端开发越来越重要。 而且它正在Swift扩展到游戏开发和物联网等领域。

Job postings also mention JavaScript more than any programming language other than Java:

职位发布还提到JavaScript,而不是Java以外的任何其他编程语言:

It’s no accident that we built our open source community’s curriculum around JavaScript. Over the past two years, more than 5,000 people have used Free Code Camp to get their first developer job.

我们围绕JavaScript构建开源社区的课程并非偶然。 在过去的两年中,有超过5,000人使用Free Code Camp获得了他们的第一份开发人员工作。

I’m not advocating JavaScript because I teach it. I teach JavaScript because it’s the surest path to a first developer job.

我不提倡JavaScript,因为我教过它。 我教JavaScript是因为这是完成第一项开发人员工作的最可靠途径。

But is JavaScript right for you? Is it worthy of being your first programming language? Let’s explore those factors I mentioned earlier.

但是JavaScript是否适合您? 值得成为您的第一门编程语言吗? 让我们探讨一下我前面提到的那些因素。

因素1:就业市场 (Factor 1: The job market)

If you’re learning to program purely out of intellectual curiosity, feel free to skip this factor. But if you — like the vast majority of people learning to program — want to use this skill to get a job, this is an important consideration.

如果您纯粹出于好奇心而学习编程,请随时跳过此因素。 但是,如果您(像绝大多数学习编程的人一样)想要使用此技能来找到工作,这是一个重要的考虑因素。

As I mentioned earlier, Java is mentioned in more job postings than any other programming language. JavaScript is a close second.

正如我之前提到的,职位招聘中提到的Java比其他任何编程语言都多。 JavaScript紧随其后。

But here’s the thing about JavaScript: even though it’s been around for 20 years, it only recently became a serious tool that companies like Netflix, Walmart, and PayPal would build entire applications around.

但是,关于JavaScript的事情就是这样:尽管它已经存在20年了,但直到最近它才成为一种重要的工具,像Netflix,Walmart和PayPal这样的公司可以围绕它构建整个应用程序。

As a result, plenty of companies are hiring JavaScript developers, but there just aren’t that many on the job market.

结果,很多公司都在雇用JavaScript开发人员,但是在就业市场上的人并不多。

There are 2.7 Java developers competing for every open Java position. Competition for PHP and iOS jobs is similarly fierce.

有2.7位Java开发人员争夺每个Java开放职位。 同样,PHP和iOS工作的竞争也很激烈。

But for every open JavaScript position, there are only 0.6 JavaScript developers. It is very much a sellers’ market for developers with JavaScript skills.

但是对于每个开放JavaScript职位,只有0.6个JavaScript开发人员。 对于具有JavaScript技能的开发人员来说,这是一个很大的卖方市场。

因素2:长期前景 (Factor 2: The long term prospects)

The average JavaScript project receives twice as many pull requests as the average Java, Python, or Ruby project. And on top of this, JavaScript is growing faster than any other popular language.

普通JavaScript项目收到的拉取请求是普通Java,Python或Ruby项目的两倍。 最重要的是,JavaScript的增长速度快于任何其他流行语言。

JavaScript’s ecosystem also benefits from a heavy investment of money and engineering talent from companies like Google, Microsoft, Facebook, and Netflix.

JavaScript的生态系统还得益于Google,Microsoft,Facebook和Netflix等公司的巨额资金和工程人才的投资。

For example, TypeScript (a statically-typed superset of JavaScript) has more than 100 open source contributors, many of whom are Microsoft and Google employees being paid to work on it.

例如,TypeScript(JavaScript的静态类型超集)拥有100多个开源贡献者,其中许多人是Microsoft和Google的雇员,正在为其工作。

This type of inter-company cooperation is harder to find with Java. Oracle — who effectively owns Java through its acquisition of Sun Microsystems — often sues companies who try to expand upon it.

用Java很难找到这种类型的公司间合作。 通过收购Sun Microsystems来有效拥有Java的Oracle 经常起诉那些试图对其进行扩展的公司。

因素3:学习困难 (Factor 3: Difficulty to learn)

Most programmers would agree that high-level scripting languages are relatively easy to learn. JavaScript falls into this category, along with Python and Ruby.

大多数程序员都同意高级脚本语言相对容易学习。 JavaScript以及Python和Ruby都属于这一类。

Even though universities still teach languages like Java and C++ as first languages, they’re considerably harder to learn.

即使大学仍将Java和C ++之类的语言作为第一语言来教,但它们却很难学习。

因素4:可以用它构建的项目 (Factor 4: Projects you can build with it)

This is where JavaScript really shines. JavaScript runs on any device that has a browser, right there in the browser. You can build basically anything with JavaScript, and share it anywhere.

这就是JavaScript真正发挥作用的地方。 JavaScript可在装有浏览器的任何设备上运行,就在浏览器中。 您基本上可以使用JavaScript构建任何东西,然后在任何地方共享。

Because of JavaScript’s ubiquity, Stack Overflow co-founder Jeff Atwood coined his now-famous law:

由于JavaScript的普及,Stack Overflow联合创始人Jeff Atwood提出了他现在著名的法律:

“Any application that can be written in JavaScript, will eventually be written in JavaScript.”

在JavaScript编写的任何应用程序,最终用JavaScript编写的。”

And with each passing month, Atwood’s Law holds strong.

而且, 随着时间的流逝 ,阿特伍德定律变得越来越强大。

Java once promised to run everywhere, too. You may remember Java Applets. Oracle officially killed them off earlier this year.

Java曾经承诺也可以在任何地方运行。 您可能还记得Java Applets 。 Oracle今年早些时候正式杀死了他们。

Python suffers from much the same problems:

Python遭受很多相同的问题:

“How can I give this game I made to my friend? Even better, is there a way can I put this on my phone so I can show it to kids at school without them having to install it? Um.” — James Hague in Retiring Python as a Teaching Language

“如何将我制作的这款游戏给我的朋友? 更好的是,有什么方法可以将其放在手机上,这样我就可以将它们展示给学校的孩子,而无需他们安装吗? 嗯。” -James Hague,《 退休使用Python作为教学语言》

By contrast, here are some apps that members of our open source community built in their browsers on CodePen. You can click through and use these right in your browser:

相比之下,这是我们的开源社区成员在CodePen的浏览器中构建的一些应用程序。 您可以在浏览器中单击并使用以下内容:

很好地学习一种语言。 然后学习第二个。 (Learn one language well. Then learn a second one.)

If you keep jumping from language to language, you won’t get far.

如果您不断从一种语言跳到另一种语言, 那么您将走不远

In order to move beyond the basics, you need to learn your first language well. Then your second language will be much, much easier.

为了超越基础知识,您需要很好地学习母语。 这样,您的第二语言就会容易得多。

From there, you can branch out, and become a more well-rounded developer by learning lots of languages:

您可以从那里分支出来,通过学习许多语言来成为更全面的开发人员:

  • C is a great way to learn how computers actually work in terms of memory management, and is useful in high-performance computing

    C是学习计算机在内存管理方面实际工作方式的一种好方法,并且对高性能计算很有用。
  • C++ is great for game development.

    C ++非常适合游戏开发。
  • Python is awesome for science and statistics.

    Python对于科学和统计资料来说是很棒的。
  • Java is important if you want to work at large tech companies.

    如果您想在大型高科技公司工作,那么Java非常重要。

But learn JavaScript first.

但是先学习JavaScript。

OK, now I’m going to attempt the impossible — I’m going to try and anticipate objections from the comments section.

好的,现在我将尝试不可能的事情-我将尝试并预期评论部分的反对意见。

异议1:但是JavaScript不会慢吗? (Objection 1: But isn’t JavaScript slow?)

JavaScript is — for most practical purposes — as fast as high-performance languages.

在大多数实际情况下,JavaScript的速度与高性能语言一样快。

JavaScript (Node.js) is orders of magnitude faster than Python, Ruby, and PHP.

JavaScript(Node.js)比Python,Ruby和PHP快几个数量级。

It is also nearly as fast as high-performance languages like C++, Java, and Go.

它也几乎与C ++,Java和Go等高性能语言一样快。

Here are the results of the most comprehensive recent cross-language benchmark:

以下是最近最全面的跨语言基准测试的结果:

异议2:但是JavaScript不是静态类型的 (Objection 2: But JavaScript isn’t statically typed)

Like Python and Ruby, JavaScript is dynamically typed, which is convenient. But you can get into trouble. Here I intend for exampleArray to be an array. I set its values, then check its length — meaning the number of elements it contains.

像Python和Ruby一样,JavaScript是动态类型的,这很方便。 但是您可能会遇到麻烦。 在这里,我打算将exampleArray作为一个数组。 我设置了它的值,然后检查了它的长度,即它包含的元素数量。

exampleArray = [1, 2]
-> [1, 2]

exampleArray.length
-> 2

But then I accidentally assign it to be a string.

但是后来我不小心将其分配为字符串。

exampleArray = “text”
-> “text”

exampleArray.length
-> 4

These kinds of errors happen all the time in dynamically typed languages. Most developers just put checks in place to prevent them, and write tests accordingly.

这些类型的错误始终以动态类型的语言发生。 大多数开发人员只是将检查放在适当的位置以防止它们发生,并相应地编写测试。

If you absolutely must have static typing in your first programming language, then I still recommend you learn JavaScript first. Then you can quickly pick up TypeScript.

如果您绝对必须在第一种编程语言中进行静态键入,那么我仍然建议您首先学习JavaScript。 然后,您可以快速选择TypeScript。

“Typescript has a learning curve, but if you already know JavaScript, it will be a smooth one.” — Alex Ewerlöf on TypeScript

“ Typescript有一个学习曲线,但是如果您已经了解JavaScript,那将是一个平稳的过程。” — TypeScript上的AlexEwerlöf

异议3:但我真的很想开发一个移动应用 (Objection 3: But I really want to make a mobile app)

I still recommend learning JavaScript first.

我仍然建议先学习JavaScript。

  1. JavaScript features several tools for making native mobile apps, such as Angular Cordova and React Native.

    JavaScript具有用于制作本地移动应用程序的多种工具,例如Angular CordovaReact Native

  2. In order for your mobile app to actually do anything interesting, it will probably need a proper back end, which you’ll want to build with a proper web development framework, like Node.js + Express.js.

    为了使您的移动应用程序实际执行任何有趣的操作,它可能需要一个适当的后端,您需要使用适当的Web开发框架(例如Node.js + Express.js)来构建该后端。

Also, it’s worth pointing out that the mobile app development’s best days may very well be behind it.

另外,值得指出的是,移动应用程序开发的最佳时期可能已经过去。

For starters, as much as people use mobile apps, nearly half of all developer jobs are web development. Compare this with a mere 8% of jobs that involve mobile app development.

对于初学者来说,与使用移动应用程序的人一样多,几乎所有开发人员的工作都是Web开发。 与此相比,仅有8%的涉及移动应用程序开发的工作。

The grand vision of “there’s an app for that” has not come to pass. Instead, most smartphone owners have stopped downloading new apps.

“为此目的有一个应用程序”的宏伟愿景尚未实现。 相反,大多数智能手机所有者已停止下载新应用

Sure — they still use apps. Mostly Facebook, Google Maps, and handful of others. As such, much of the demand for mobile app developers is concentrated in a few large employers.

当然-他们仍在使用应用程序。 主要是Facebook,Google地图以及其他少数几个。 因此,对移动应用程序开发人员的大部分需求都集中在少数大型雇主上。

The outlook for those mobile development jobs is hard to forecast. Many aspects of developing, maintaining, and distributing mobile apps are easier with JavaScript. So companies like Facebook and Google are investing heavily in better tools for building these using JavaScript.

这些移动开发工作的前景很难预测。 使用JavaScript可以更轻松地开发,维护和分发移动应用程序的许多方面。 因此,像Facebook和Google这样的公司都在大力投资于更好的工具,以使用JavaScript构建这些工具。

As of 2016, pretty much all development is web development. Everything touches that big platform that is “the web.” And the next wave of devices that you’ll talk to around your home, and cars that pick your kids up from school — they’ll all be piped together using the web, too.

截至2016年,几乎所有开发都是Web开发。 一切都触及那个大平台,即“网络”。 下一波您将在家里与之交谈的设备,以及将孩子接送学校的汽车-它们也都将通过网络通过管道连接在一起。

And that means JavaScript.

那就是JavaScript。

异议4:JavaScript是否不是10天内编写的玩具语言? (Objection 4: Isn’t JavaScript a toy language that was written in 10 days?)

JavaScript has a quirky history.

JavaScript具有古怪的历史

You will undoubtedly hear people crack jokes at its expense.

毫无疑问,您会听到人们为笑话而付出的代价。

Well people love to hate on C++, too. And like JavaScript, C++ has succeeded despite this hate, and now it’s pretty much everywhere as well.

人们也很喜欢讨厌C ++。 和JavaScript一样,尽管有这种讨厌,C ++还是成功了,现在在几乎所有地方也是如此。

So if anybody ever gives you a hard time for learning JavaScript instead of elite-language-of-the-week, just remember the famous words of the guy who created C++:

因此,如果有人让您很难学习JavaScript,而不是每周学习精通语言,那么请记住创建C ++的那个人的著名话:

“There are only two kinds of programming languages: those people always bitch about and those nobody uses.” — Bjarne Stroustrup
“只有两种编程语言:那些总是无聊的人和那些没人使用的语言。” — Bjarne Stroustrup

I only write about programming and technology. If you follow me on Twitter I won’t waste your time. ?

我只写关于编程和技术的文章。 如果您在Twitter上关注我,我不会浪费您的时间。

翻译自: https://www.freecodecamp.org/news/what-programming-language-should-i-learn-first-19a33b0a467d/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值