对 JavaScript 新手有经验的程序员的推荐?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3956440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 02:49:11  来源:igfitidea点击:

Recommendations for an experienced programmer new to JavaScript?

javascriptprogramming-languages

提问by R.. GitHub STOP HELPING ICE

I come from a C/Unix background, with a lot of experience in shell scripting, and some on Perl, elisp, etc. too. But now I'm getting into some work where I'll need to be developing interactive web-based interfaces, and I need to learn JavaScript. My problem is that all the resources I've found online for learning JavaScript seem to be targeted at an audience who's never programmed, and their authors don't seem much better. As soon as I see "validating user input to take the load off your server" as one of the great uses for JS, I want to scream and I feel like I can't trust anything else the author says. ;-)

我来自 C/Unix 背景,在 shell 脚本方面有很多经验,也有一些 Perl、elisp 等方面的经验。但是现在我开始从事一些工作,需要开发基于 Web 的交互式界面,并且我需要学习 JavaScript。我的问题是,我在网上找到的所有用于学习 JavaScript 的资源似乎都是针对从未编程过的受众,而且它们的作者似乎也好不到哪里去。一旦我看到“验证用户输入以减轻服务器负载”是 JS 的重要用途之一,我就想尖叫,我觉得我不能相信作者所说的任何其他内容。;-)

Can anyone recommend good resources for an experienced programmer wanting to learn JS as a new language? Ideally I'd like to get started online, but dead tree recommendations would be welcome too, especially if I can preview them online.

任何人都可以为想要学习 JS 作为一门新语言的有经验的程序员推荐好的资源吗?理想情况下,我想在线开始,但也欢迎死树推荐,特别是如果我可以在线预览它们。

回答by Greg Hewgill

A great JavaScript book for experienced programmers is Doug Crockford's JavaScript: The Good Parts. It's short, assumes you know what you're doing, is opinionated, and is not a tutorial.

对于有经验的程序员来说,一本很棒的 JavaScript 书籍是 Doug Crockford 的JavaScript: The Good Parts。它很短,假设您知道自己在做什么,是固执己见的,而不是教程。

回答by Fordi

My advice: Forget what you know about object oriented programming. Attempts to apply the inheritance paradigms from an OO language have repeatedly overcomplicated many, many chunks of JS code.

我的建议:忘记你对面向对象编程的了解。尝试应用 OO 语言的继承范式已经反复使许多 JS 代码块变得过于复杂。

Prototyping is not Class construction. Object instantiation is not Class instantiation. "Classes" are not real.

原型设计不是类构建。对象实例化不是类实例化。“类”不是真实的。

There are ways to get what you want. You can even have something akin to privates - but they are not methods or members. They are merely locally scoped. Inheritance is often faked, but with mixed results, and universally at the expense of data hiding.

有很多方法可以得到你想要的东西。您甚至可以拥有类似于私有的东西 - 但它们不是方法或成员。它们只是局部作用域。继承通常是伪造的,但结果好坏参半,而且普遍以数据隐藏为代价。

Javascript is prototyped. It is not object oriented. Keep that in mind every time you think something like, "Man, an interface here would be awesome..."

Javascript 是原型。它不是面向对象的。每次你想“伙计,这里的界面会很棒……”时,请记住这一点。

回答by Stan Rogers

Take a look at Eloquent JavaScript. It doesn't cover everything, but it will move you towards idiomatic JavaScript programming -- things like functional programming, closures and prototypes. (The online version comes complete with a sandbox tutorial environment.) The rest, after all, is just knowing how to use references.

看看Eloquent JavaScript。它并没有涵盖所有内容,但它会让你转向惯用的 JavaScript 编程——比如函数式编程、闭包和原型。(在线版本带有沙盒教程环境。)毕竟,剩下的就是知道如何使用引用。

回答by qichuan

Javascript Guide from Mozilla Developer Network, a simple and yet informative guide, gives beginners a big picture of JS in a short time.

Mozilla 开发者网络的 Javascript 指南,一个简单但内容丰富的指南,让初学者在短时间内全面了解 JS。

https://developer.mozilla.org/en/JavaScript/Guide

https://developer.mozilla.org/en/JavaScript/Guide

回答by Edgar Bonet

JavaScript: the definitive guideis one of my favorite programming books: http://oreilly.com/catalog/9780596101992

JavaScript:权威指南是我最喜欢的编程书籍之一:http: //oreilly.com/catalog/9780596101992