Skip to content

Latest commit

 

History

History
106 lines (77 loc) · 4.15 KB

File metadata and controls

106 lines (77 loc) · 4.15 KB

Programmingruby: The Pragmatic Programmer's Guide by Dave Thomas, with Chad Fowler and Andy Hunt

Introduction

Programmingruby (commonly referred to as the "Pickaxe" book) is a definitive guide toruby, covering everything from the basics to advanced topics. The book is split into three main sections: an introduction toruby, a language reference, and a comprehensive guide toruby’s standard library.


Part 1:ruby in Review

1. Getting Started

  • Introduction toruby's philosophy: simplicity, readability, and developer productivity.
  • Setting up theruby environment and tools, including IRB for interactiveruby sessions.

2.ruby Basics

  • Core concepts: variables, data types, control structures (if, case, loops). -ruby’s flexible syntax encourages concise and expressive code.

3. Classes, Objects, and Modules

  • Everything inruby is an object, including numbers and classes.
  • Object-oriented features: inheritance, encapsulation, and polymorphism.
  • Modules provide namespaces and a way to share reusable functionality via mixins.

Part 2:ruby Language

4. Working with Data

  • Strings: Manipulation with methods like gsub, split, and interpolation.
  • Collections: Arrays and Hashes as core tools for managing lists and key-value data.
  • Ranges, Sets, and custom enumerable structures.

5. Blocks, Procs, and Lambdas

  • Blocks as a fundamental part ofruby's syntax for iteration and callbacks.
  • Difference between Proc and lambda: subtle variations in argument handling and return behavior.

6. Exception Handling

  • Using begin-rescue-ensure blocks to handle errors gracefully.
  • Raising and rescuing exceptions, and creating custom exception classes.

7.ruby’s Metaprogramming

  • Dynamic method creation using define_method and method_missing.
  • Introspection tools like Object#methods and ObjectSpace.

Part 3:ruby’s Built-In Library

8. Core Library

  • Overview ofruby’s standard types and classes, including String, Array, Hash, and Enumerable.
  • Numeric operations and utilities like BigDecimal and Rational.

9. File and I/O

  • File handling using File, IO, and Dir classes.
  • Reading and writing files, directory traversal, and temporary file handling.

10. Threads and Concurrency

  • Using threads for multitasking within a singleruby process.
  • Synchronization and thread-safe programming techniques.

Part 4: Practicalruby Development

11. Unit Testing

  • Built-in support for unit testing with Test::Unit.
  • Writing test cases and assertions for reliable software.

12. RDoc and Documentation

  • Use RDoc to generate documentation directly fromruby source code.
  • Embed comments in code to describe methods, parameters, and examples.

13.ruby Gems and Libraries

  • Using gem to install, manage, and updateruby libraries.
  • Structure and publish custom gems, including metadata and dependencies.

14. Network Programming

  • Classes for HTTP, FTP, and socket programming.
  • Writing basic servers and clients usingruby’s networking features.

Part 5: Advanced Topics

15. Reflection and Dynamic Programming

  • Introspection techniques: querying objects about their state and capabilities.
  • Modifying classes and modules at runtime.

16. Embeddingruby

  • Integratingruby with other languages like C for performance-critical tasks.
  • Usingruby as a scripting engine within larger applications.

17. Extendingruby

  • Write nativeruby extensions in C.
  • Best practices for integrating external libraries withruby code.

Part 6:ruby Reference

18. Standard Library Reference

  • A comprehensive overview ofruby’s built-in classes, modules, and methods.
  • Examples for common tasks: file manipulation, text processing, and more.

19. Language Reference

  • Detailed explanation ofruby’s syntax, keywords, and constructs.
  • Special topics like regular expressions, threading, and garbage collection.

Conclusion

The Pickaxe book is a must-have resource forruby developers, covering beginner-friendly topics, advanced techniques, and an exhaustive reference toruby’s core and standard libraries. It is both a learning guide and a go-to manual forruby programming.