注冊(cè) | 登錄讀書好,好讀書,讀好書!
讀書網(wǎng)-DuShu.com
當(dāng)前位置: 首頁(yè)出版圖書科學(xué)技術(shù)計(jì)算機(jī)/網(wǎng)絡(luò)軟件與程序設(shè)計(jì)其他編程語(yǔ)言/工具Ruby最佳實(shí)踐(影印版)

Ruby最佳實(shí)踐(影印版)

Ruby最佳實(shí)踐(影印版)

定 價(jià):¥48.00

作 者: 布朗(Gregory T.Brown) 著
出版社: 東南大學(xué)出版社
叢編項(xiàng):
標(biāo) 簽: 程序設(shè)計(jì)

ISBN: 9787564119355 出版時(shí)間: 2010-01-01 包裝: 平裝
開本: 16開 頁(yè)數(shù): 309 字?jǐn)?shù):  

內(nèi)容簡(jiǎn)介

  你能夠編寫真正優(yōu)雅的Ruby代碼嗎?《Ruby最佳實(shí)踐》正是為想要像專家那樣使用Ruby的程序員所準(zhǔn)備的。《Ruby 最佳實(shí)踐(影印版)》由Ruby項(xiàng)目Prawn的開發(fā)者所著,簡(jiǎn)潔地向你闡釋如何使用Ruby編寫優(yōu)美的應(yīng)用程序接口和領(lǐng)域特定語(yǔ)言。此外,還包括如何應(yīng)用函數(shù)式編程的思想和技術(shù),使代碼更簡(jiǎn)潔,使你更有效率。通過(guò)《Ruby 最佳實(shí)踐(影印版)》,你將會(huì)學(xué)到如何編寫可讀性更高,表達(dá)能力更強(qiáng)的代碼,以及許多其他方面的內(nèi)容。《Ruby最佳實(shí)踐》將會(huì)幫助你:* 理解Ruby代碼塊所蘊(yùn)含的神秘力量* 學(xué)習(xí)如何在不破壞原有Ruby代碼的情況下進(jìn)行調(diào)整,例如運(yùn)行時(shí)在模塊內(nèi)糅合* 探究測(cè)試與調(diào)試中的細(xì)節(jié),以及如何從易測(cè)性出發(fā)進(jìn)行設(shè)計(jì)* 學(xué)習(xí)通過(guò)讓事情保持簡(jiǎn)單來(lái)編寫快速代碼* 用于文本處理和文件管理的開發(fā)策略,包括正則表達(dá)式* 理解為什么會(huì)發(fā)生錯(cuò)誤以及錯(cuò)誤是如何發(fā)生的* 利用Ruby的多語(yǔ)言特性減少文化障礙《Ruby 最佳實(shí)踐(影印版)》還包含多個(gè)章節(jié)對(duì)測(cè)試代碼、設(shè)計(jì)應(yīng)用程序接口以及項(xiàng)目維護(hù)做了全面介紹?!禦uby最佳實(shí)踐》將陪伴你學(xué)習(xí)如何將這門豐富、優(yōu)美的語(yǔ)言發(fā)揮到極致。

作者簡(jiǎn)介

  Gregory T. Brown是康涅狄格州紐黑文市的一位Ruby愛(ài)好者,他的大多數(shù)時(shí)間都花在了與Ruby語(yǔ)言相關(guān)的自由軟件項(xiàng)目上。他是Ruport的原作者,并且是Prawn的作者,該Ruby庫(kù)被用來(lái)生成PDF文檔。

圖書目錄

Foreword
Preface
1. Driving Code Through Tests
A Quick Note on Testing Frameworks
Designing for Testability
Testing Fundamentals
Well-Focused Examples
Testing Exceptions
Run the Whole Suite at Once
Advanced Testing Techniques
Using Mocks and Stubs
Testing Complex Output
Keeping Things Organized
Embedding Tests in Library Files
Test Helpers
Custom Assertions
Conclusions
2. Designing Beautiful APIs
Designing for Convenience: Ruport’s Table( ) feature
Ruby’s Secret Power: Flexible Argument Processing
Standard Ordinal Arguments
Ordinal Arguments with Optional Parameters
Pseudo-Keyword Arguments
Treating Arguments As an Array
Ruby’s Other Secret Power: Code Blocks
Working with Enumerable
Using Blocks to Abstract Pre- and Postprocessing
Blocks As Dynamic Callbacks
Blocks for Interface Simplification
Avoiding Surprises
Use attr_reader, attr_writer, and attr_accessor
Understand What method? and method! Mean
Make Use of Custom Operators
Conclusions
3. Mastering the Dynamic Toolkit
BlankSlate: A BasicObject on Steroids
Building Flexible Interfaces
Making instance_eval( ) Optional
Handling Messages with method_missing( ) and send( )
Dual-Purpose Accessors
Implementing Per-Object Behavior
Extending and Modifying Preexisting Code
Adding New Functionality
Modification via Aliasing
Per-Object Modification
Building Classes and Modules Programmatically
Registering Hooks and Callbacks
Detecting Newly Added Functionality
Tracking Inheritance
Tracking Mixins
Conclusions
4. Text Processing and File Management
Line-Based File Processing with State Tracking
Regular Expressions
Don’t Work Too Hard
Anchors Are Your Friends
Use Caution When Working with Quantifiers
Working with Files
Using Pathname and FileUtils
The tempfile Standard Library
Automatic Temporary Directory Handling
Collision Avoidance
Same Old I/O Operations
Automatic Unlinking
Text-Processing Strategies
Advanced Line Processing
Atomic Saves
Conclusions
5. Functional Programming Techniques
Laziness Can Be a Virtue (A Look at lazy.rb)
Minimizing Mutable State and Reducing Side Effects
Modular Code Organization
Memoization
Infinite Lists
Higher-Order Procedures
Conclusions
6. When Things Go Wrong
A Process for Debugging Ruby Code
Capturing the Essence of a Defect
Scrutinizing Your Code
Utilizing Reflection
Improving inspect Output
Finding Needles in a Haystack
Working with Logger
Conclusions
7. Reducing Cultural Barriers
m17n by Example: A Look at Ruby’s CSV Standard Library
Portable m17n Through UTF-8 Transcoding
Source Encodings
Working with Files
Transcoding User Input in an Organized Fashion
m17n in Standalone Scripts
Inferring Encodings from Locale
Customizing Encoding Defaults
m17n-Safe Low-Level Text Processing
Localizing Your Code
Conclusions
8. Skillful Project Maintenance
Exploring a Well-Organized Ruby Project (Haml)
Conventions to Know About
What Goes in a README
Laying Out Your Library
Executables
Tests
Examples
API Documentation via RDoc
Basic Documentation Techniques and Guidelines
Controlling Output with RDoc Directives
The RubyGems Package Manager
Writing a Gem::Specification
Working with Dependencies
Rake: Ruby’s Built-in Build Utility
Conclusions
A. Writing Backward-Compatible Code
B. Leveraging Ruby’s Standard Library
C. Ruby Worst Practices
Index

本目錄推薦

掃描二維碼
Copyright ? 讀書網(wǎng) m.ranfinancial.com 2005-2020, All Rights Reserved.
鄂ICP備15019699號(hào) 鄂公網(wǎng)安備 42010302001612號(hào)