Skip to Content
精通模块化JavaScript
book

精通模块化JavaScript

by Nicolás Bevacqua
April 2020
Intermediate to advanced
177 pages
1h 45m
Chinese
Publishing House of Electronics Industry
Content preview from 精通模块化JavaScript
1.5
 模块化
JavaScript
的必要性
15
万象的架构有可能会为我们省去很多麻烦,但是这样的设计可能要花大量
时间预先思考与准备,并且可能会让我们卡在一系列难以保持同步的抽象
中,短期内也没有可预见的收益。在没有数据表明流量即将出现爆发式增
长的情况下,专注于解决当下或即将遇到的问题,比去预估可能到来的爆
发式流量增长而为其设计对应的基础设施要好得多。
当我们不用这种长期模式做规划时,就会发生一件有趣的事情 :我们的系
统更加自然地发展,能适应近期的需求,并逐渐向支持更大的应用程序和
更多的需求发展。当这个过程渐进地进行时,我们会注意到,随着系统的
成长,各种抽象会以一种正确的方式被提取出来或被丢弃。如果过早地去
做抽象,最终会发现这些抽象都是错误的抽象,而且我们将为这些错误付
出代价。糟糕的抽象会迫使整个应用程序顺从它的意愿。当意识到这个抽
象很糟糕,应该被移除时,我们可能已经对它投入了大量的精力,以至于
从其中撤出需要很大的代价。这一点再加上“沉没成本(
sunk cost
)”谬 论(
因为在这个抽象上花费了大量的时间和心血,我们往往会试图保留它),的
确是很危险的。
本书的一个重要内容就是,帮助读者理解如何在正确的时间识别和利用正
确的抽象,将承担的风险降到最低。
1.5
 模块化
JavaScript
的必要性
由于历史原因,
JavaScript
在模块化设计方面的做法特别有意思。在早期的
Web
开发中,很长一段时间内
JavaScript
的使用没有什么章法,很多人对
这门语言的了解仅限于显示错误的报警框
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

数据驱动力:企业数据分析实战

数据驱动力:企业数据分析实战

Carl Anderson
基于Python的智能文本分析

基于Python的智能文本分析

Benjamin Bengfort, Rebecca Bilbro, Tony Ojeda
Lua游戏AI开发指南

Lua游戏AI开发指南

Posts & Telecom Press, David Young

Publisher Resources

ISBN: 9787121387074