Refactoring JavaScript: Turning Bad Code Into Good Code
Evan Burchard
- 出版商: O'Reilly
- 出版日期: 2017-05-02
- 定價: $1,650
- 售價: 9.0 折 $1,485
- 語言: 英文
- 頁數: 442
- 裝訂: Paperback
- ISBN: 1491964928
- ISBN-13: 9781491964927
-
相關分類:
JavaScript、Refactoring
-
相關翻譯:
重構 JavaScript (Refactoring JavaScript: Turning Bad Code Into Good Code) (繁中版)
立即出貨
買這商品的人也買了...
-
$620$527 -
$990JavaScript Cookbook, 2/e (Paperback)
-
$780$616 -
$360$284 -
$520$442 -
$403解析深度學習 : 語音識別實踐
-
$520$442 -
$680$578 -
$500$395 -
$580$458 -
$520$442 -
$480$379 -
$380$296 -
$530$419 -
$590$460 -
$1,575Practical Modern JavaScript: Dive into ES6 and the future of JavaScript
-
$540$459 -
$390$332 -
$450$356 -
$540$459 -
$480$379 -
$400$312 -
$580$458 -
$560$437 -
$1,485Mastering Modular JavaScript (Paperback)
相關主題
商品描述
How often do you hear people say things like this? "Our JavaScript is a mess, but we’re thinking about using [framework of the month]."
Like it or not, JavaScript is not going away. No matter what framework or ”compiles-to-js” language or library you use, bugs and performance concerns will always be an issue if the underlying quality of your JavaScript is poor. Rewrites, including porting to the framework of the month are terribly expensive and unpredictable. The bugs won’t magically go away, and can happily reproduce themselves in a new context. To complicate things further, features will get dropped, at least temporarily.
The other popular method of fixing your JS is playing “JavaScript Jenga,” where each developer slowly and carefully takes their best guess at how the out-of-control system can be altered to allow for new features, hoping that this doesn’t bring the whole stack of blocks down. This book provides clear guidance on how best to avoid these pathological approaches to writing JavaScript:
- Recognize you have a problem with your JavaScript quality.
- Forgive the code you have now, and the developers who made it.
- Learn repeatable, memorable, and time-saving refactoring techniques.
- Apply these techniques as you work, fixing things along the way.
- Internalize these techniques, and avoid writing as much problematic code to begin with.
Bad code doesn’t have to stay that way. And making it better doesn’t have to be intimidating or unreasonably expensive.
商品描述(中文翻譯)
你有多常聽到人們這樣說呢?「我們的 JavaScript 亂七八糟,但我們正在考慮使用[本月熱門框架]。」不管你喜不喜歡,JavaScript 是不會消失的。無論你使用什麼框架、編譯成 JavaScript 的語言或是函式庫,如果你的 JavaScript 基礎品質不好,那麼錯誤和效能問題將永遠存在。重寫程式碼,包括轉換到本月熱門框架,代價高昂且難以預測。錯誤不會神奇地消失,並且可能在新的環境中重新產生。更進一步讓事情變得複雜的是,功能可能會被暫時刪除。
另一種修復 JavaScript 的流行方法是玩「JavaScript 排樓塔」,每個開發者都慢慢且謹慎地猜測如何修改失控的系統以容納新功能,希望這不會導致整個堆疊崩潰。本書提供清晰的指導,以避免這些病態的 JavaScript 編寫方法:
1. 認識你的 JavaScript 品質問題。
2. 原諒現有的程式碼和開發者。
3. 學習可重複、易記和節省時間的重構技巧。
4. 在工作中應用這些技巧,並在進行中修復問題。
5. 內化這些技巧,避免一開始就寫出問題程式碼。
糟糕的程式碼不必一直保持那樣。而且讓它變得更好不必令人生畏或過於昂貴。