Eloquent JavaScript (4th edition)
Lập trình JavaScript bài bản, có dự án thực hành.
Vào phòng đọc cùng mọi ngườiKhông cần tài khoản. Chọn một chỗ ngồi, sách mở ngay trên bàn của bạn.
Đọc thử
We think we are creating the system for our own purposes. We believe we are making it in our own image... But the computer is not really like us. It is a projection of a very slim part of ourselves: that portion devoted to logic, order, rule, and clarity. Ellen Ullman, Close to the Machine: Technophilia and Its Discontents
This is a book about instructing computers. Computers are about as common as screwdrivers today, but they are quite a bit more complex, and making them do what you want them to do isn’t always easy.
If the task you have for your computer is a common, well-understood one, such as showing you your email or acting like a calculator, you can open the appropriate application and get to work. But for unique or open-ended tasks, there often is no appropriate application.
That is where programming may come in. Programming is the act of constructing a program—a set of precise instructions telling a computer what to do. Because computers are dumb, pedantic beasts, programming is fundamentally tedious and frustrating.
Fortunately, if you can get over that fact—and maybe even enjoy the rigor of thinking in terms that dumb machines can deal with—programming can be rewarding. It allows you to do things in seconds that would take forever by hand. It is a way to make your computer tool do things that it couldn’t do before. On top of that, it makes for a wonderful game of puzzle solving and abstract thinking.
Most programming is done with programming languages. A programming language is an artificially constructed language used to instruct computers. It is interesting that the most effective way we’ve found to communicate with a computer borrows so heavily from the way we communicate with each other. Like human languages, computer languages allow words and phrases to be combined in new ways, making it possible to express ever new concepts.
At one point, language-based interfaces, such as the BASIC and DOS prompts of the 1980s and 1990s, were the main method of interacting with computers. For routine computer use, these have largely been replaced with visual interfaces, which are easier to learn but offer less freedom. But if you know where to look, the languages are still there. One of them, JavaScript, is built into every modern web browser—and is thus available on almost every device.
This book will try to make you familiar enough with this language to do useful and amusing things with it.
Besides explaining JavaScript, I will introduce the basic principles of programming. Programming, it turns out, is hard. The fundamental rules are simple and clear, but programs built on top of these rules tend to become complex enough to introduce their own rules and complexity. You’re building your own maze, in a way, and you can easily get lost in it.
There will be times when reading this book feels terribly frustrating. If you are new to programming, there will be a lot of new material to digest. Much of this material will then be combined in ways that require you to make additional connections.
It is up to you to make the necessary effort. When you are struggling to follow the book, do not jump to any conclusions about your own capabilities. You are fine—you just need to keep at it. Take a break, reread some material, and make sure you read and understand the example programs and exercises. Learning is hard work, but everything you learn is yours and will make further learning easier.
When action grows unprofitable, gather information; when information grows unprofitable, sleep. Ursula K. Le Guin, The Left Hand of Darkness
Cùng kệ Giáo trình
- Algebra and Trigonometry 2eOpenStax (Jay Abramson)
- Calculus Volume 1OpenStax (Gilbert Strang, Edwin “Jed” Herman)
- Introductory Statistics 2eOpenStax (Barbara Illowsky, Susan Dean)
- PhysicsOpenStax (Paul Peter Urone, Roger Hinrichs)
- Chemistry 2eOpenStax (Paul Flowers, Klaus Theopold, Richard Langley, William R. Robinson, PhD)
- Concepts of BiologyOpenStax (Samantha Fowler, Rebecca Roush, James Wise)
Nguồn: https://eloquentjavascript.net/
Bản quyền: CC BY-NC 3.0 · Marijn Haverbeke · official EPUB, unchanged (code in the book: MIT)