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
56
3
模块设计
从字面上来看,“
Move Deliberately and Experiment
(谨慎地行动和尝试)”
这个口号可能更好。它和
Facebook
那个口号的观点是相同的,它的真正
含义并不意味着要揭示或解释什么。进行尝试是软件设计和开发的一个关
键方面。我们应该不断尝试和验证新的想法,验证它们是否比现有解决方
案更好。可以把“快速行动,打破常规”理解为尽早做以及经常做
A/B
1
,“谨慎地行动和尝试”就很好地传达了这个意思。
“谨慎地行动”是指所做的一切都是有道理可循的。工程进度很少会受到开
发团队加快进度意愿的影响,但是通常要受制于产品版本发布周期,不得
不满足这些版本发布所需的复杂需求。当然,每个人都希望工程进度尽可
能快,但是接口的设计不应该太仓促,不管我们处理的这个接口是体系结构、
层、组件还是函数。内部结构对于正确处理需求并不重要,因为只要接口
保持不变,内部结构就可以在稍后进行改进,以提升性能或可读性。我不
是提倡草率开发内部结构,而是鼓励经过充分的思考周全地设计接口。
3.2
 
CRUST
原则
我们的讨论越来越接近函数内部结构了,不过这部分内容将在第
4
章详细
讨论。在此之前,我们需要解决组件级别上的一些问题。本节探讨如何遵
循第
2
章所述的
CRUST
原则来保持组件的简单性。
3.2.1
 适度使用
DRY
原则
DRY
Don
t Repeat Yourself
,即避免重复的代码和逻辑)是软件开发中最
1
 
A/B
测试,用户测试的一种形式,即让一小部分用户使用与大部分用户不同的产品版本,然 ...
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