Eloquent Ruby
Foreword by Obie Fernandez, Series Editor
Samenvatting
It's easy to write correct Ruby code, but to gain the fluency needed to write great Ruby code, you must go beyond syntax and absorb the "Ruby way" of thinking and problem solving. In 'Eloquent Ruby', Russ Olsen helps you write Ruby like true Rubyists do-so you can leverage its immense, surprising power.
Olsen draws on years of experience internalizing the Ruby culture and teaching Ruby to other programmers. He guides you to the "Ah Ha!"moments when it suddenly becomes clear why Ruby works the way it does, and how you can take advantage of this language's elegance and expressiveness.
'Eloquent Ruby' starts small, answering tactical questions focused on a single statement, method, test, or bug. You'll learn how to write code that actually looks like Ruby (not Java or C#); why Ruby has so many control structures; how to use strings, expressions, and symbols; and what dynamic typing is really good for.
Next, the book addresses bigger questions related to building methods and classes. You'll discover why Ruby classes contain so many tiny methods, when to use operator overloading, and when to avoid it. Olsen explains how to write Ruby code that writes its own code-and why you'll want to. He concludes with powerful project-level features and techniques ranging from gems to Domain Specific Languages.
A part of the renowned Addison-Wesley Professional Ruby Series, 'Eloquent Ruby' will help you "put on your Ruby-colored glasses" and get results that make you a true believer.
Specificaties
Inhoudsopgave
Preface
Acknowledgments
About the Author
PART 1: The Basics
1. Write Code That Looks Like Ruby
2. Choose the Right Control Structure
3. Take Advantage of Ruby's Smart Collections
4. Take Advantage of Ruby's Smart Strings
5. Find the Right String with Regular Expressions
6. Use Symbols to Stand for Something
7. Treat Everything Like an Object-Because Everything Is
8. Embrace Dynamic Typing
9. Write Specs!
PART 2: Classes, Modules, and Blocks
10. Construct Your Classes from Short, Focused Methods
11. Define Operators Respectfully
12. Create Classes That Understand Equality
13. Get the Behavior You Need with Singleton and Class Methods
14. Use Class Instance Variables
15. Use Modules as Name Spaces
16. Use Modules as Mixins
17. Use Blocks to Iterate
18. Execute Around with a Block
19. Save Blocks to Execute Later
PART 3: Metaprogramming
20. Use Hooks to Keep Your Program Informed
21. Use method_missing for Flexible Error Handling
22. Use method_missing for Delegation
23. Use method_missing to Build Flexible APIs
24. Update Existing Classes with Monkey Patching
25. Create Self-Modifying Classes
26. Create Classes That Modify Their Subclasses
PART 4: Pulling It All Together
27. Invent Internal DSLs
28. Build External DSLs for Flexible Syntax
29. Package Your Programs as Gems
30. Know Your Ruby Implementation
31. Keep an Open Mind to Go with Those Open Classes
Appendix: Going Further
Index
Anderen die dit boek kochten, kochten ook
Net verschenen
Rubrieken
- aanbestedingsrecht
- aansprakelijkheids- en verzekeringsrecht
- accountancy
- algemeen juridisch
- arbeidsrecht
- bank- en effectenrecht
- bestuursrecht
- bouwrecht
- burgerlijk recht en procesrecht
- europees-internationaal recht
- fiscaal recht
- gezondheidsrecht
- insolventierecht
- intellectuele eigendom en ict-recht
- management
- mens en maatschappij
- milieu- en omgevingsrecht
- notarieel recht
- ondernemingsrecht
- pensioenrecht
- personen- en familierecht
- sociale zekerheidsrecht
- staatsrecht
- strafrecht en criminologie
- vastgoed- en huurrecht
- vreemdelingenrecht