text.skipToContent text.skipToNavigation
  1. Home
  2. Computer Science & IT
  3. Eloquent Ruby

Eloquent Ruby, 1st edition

  • Russ Olsen

Published by Addison-Wesley Professional (February 11th 2011) - Copyright © 2011

1st edition

Chosen format
View all
Eloquent Ruby

ISBN-13: 9780321700278

Includes: Unassigned

This product is not available in your country

What's included

  • Unassigned

Overview

Table of contents

Foreword xix

Preface xxi

Acknowledgments xxv

About the Author xxvii

 

PART I: The Basics 1

 

Chapter 1: Write Code That Looks Like Ruby 3

The Very Basic Basics 4

Go Easy on the Comments 6

Camels for Classes, Snakes Everywhere Else 8

Parentheses Are Optional but Are Occasionally Forbidden 9

Folding Up Those Lines 10

Folding Up Those Code Blocks 11

Staying Out of Trouble 12

In the Wild 13

Wrapping Up 15

 

Chapter 2: Choose the Right Control Structure 17

If, Unless, While, and Until 17

Use the Modifier Forms Where Appropriate 19

Use each, Not for 20

A Case of Programming Logic 21

Staying Out of Trouble 23

In the Wild 25

Wrapping Up 27

 

Chapter 3: Take Advantage of Ruby’s Smart Collections 29

Literal Shortcuts 29

Instant Arrays and Hashes from Method Calls 30

Running Through Your Collection 33

Beware the Bang! 36

Rely on the Order of Your Hashes 38

In the Wild 38

Staying Out of Trouble 40

Wrapping Up 42

 

Chapter 4: Take Advantage of Ruby’s Smart Strings 43

Coming Up with a String 44

Another API to Master 47

The String: A Place for Your Lines, Characters, and Bytes 49

In the Wild 50

Staying Out of Trouble 51

Wrapping Up 52

<

For teachers

All the material you need to teach your courses.

Discover teaching material