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
1
模块化思维
正如前言中所讨论的,在我们开发软件项目时,复杂性似乎无处不在。抽
象也是如此,它将复杂性隐藏在我们不敢触及的“岩石”之下,这些岩石
是我们通往另一个世界的接口,让我们可以远离复杂性,几乎不会去想复
杂性。
JavaScript
语言也是如此。尽管动态编程语言很强大,但是当我们使
用它们时,往往更容易(甚至会不由自主地)写出复杂的程序。
我们首先讨论如何更好地将抽象、接口及其底层概念应用到我们的工作中。
如此一来,在处理项目、项目中的特性、特性中的功能模块,甚至一个函
数的分支时,我们就可以将需要关注的复杂性最小化。
1.1
 模块化思维简介
拥抱
模块化思维
module thinking
),就是要认识到复杂性(复杂的逻辑)
最终是不可避免的。同时,复杂性是可以被隐藏在接口之下的,用户几乎
不会看到或想到它。但一件很棘手的事情是,这个接口必须设计得很好,
我们才不会产生挫败感。这种挫败感可能会促使我们深入了解这个糟糕的
2
1
模块化思维
接口,结果发现它的实现逻辑更复杂。如果一开始就不存在这个接口,也
许程序代码会相对容易维护与阅读。
系统可以按粒度划分:我们将系统分为几个项目,一个项目由多个应用组成,
每个应用又包含几个层级,其中有数百个模块,由数千个函数组成。通过
对代码进行合理的模块化 ...
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