Effective Ruby

Video description

4+ Hours of Video Training

Overview

Effective Ruby LiveLessons Video Training explains the tips, tricks, and best practices used by the most proficient Rubyists. The series is based on Effective Ruby, the book written by Peter Jones for the Effective Software Development Series. Each lesson contains a set of items designed to provide expert guidance on what to do and what to avoid when writing Ruby. Hands-on demonstrations help the viewer understand how to put each item into action.

Description

Each of the video’s five lessons includes items centered on a key topic. The video starts with items focused on how to make effective use of arrays and hashes before moving on to lessons that teach viewers how to improve their objects by creating seams between them and how to write excellent tests for their Ruby applications. Next, the training teaches viewers how to solve problems associated with enumerables and callables, and finally how to best make use of the standard library. After watching this video, Rubyists will have gained the knowledge necessary to really master the language; viewers will be able to immediately apply the advice, tips, and tricks learned to the Ruby programs they’re writing to improve the quality of their code.

Related Files

The companion files for this LiveLesson can be downloaded from https://github.com/samphippen/efrll.

About the Instructor

Sam Phippen has been writing software for more than seven years. Sam has spent the last four years building Ruby and Ruby on Rails applications. He routinely gives conference talks about software design and testing and currently serves the Ruby community as a member of the RSpec core team. Sam regularly contributes to Open Source Ruby applications and works as a consultant at Fun and Plausible Solutions. Mostly, Sam helps his clients with software design and improving the quality of the applications that they are building. He loves refactoring sticky rails applications and uses a number of principles of object oriented design to ensure that the software he works on will be maintainable far into the future.

Skill Level

  • Intermediate
  • Advanced

What You Will Learn

  • How to write Ruby code that will be easier to change in the future
  • How to make better use of the standard library and Ruby language features for greater productivity
  • How to make better and faster technical decisions through the development of a “reference frame”

Who Should Take This Course

  • Professional Ruby or Rails developers with 1 5 years of experience

Course Requirements

  • Familiarity with the fundamentals of Ruby syntax
  • Some experience coding Ruby professionally

Table of Contents

Lesson 1: Arrays and Hashes

In the first lesson you learn some of the more advanced ways to use Ruby’s built-in collection classes to simplify your applications, as well as some of the common pitfalls associated with using these objects.

Lesson 2: Seams

In Lesson 2, you learn ways to decouple objects in your system. You also discover some standards and practices used by expert Ruby developers for creating seams between objects.

Lesson 3: Testing

In Lesson 3, you learn some of the easiest ways to improve your tests, and how to improve the design of your system through the use of well-structured tests.

Lesson 4: Enumerables and Callables

Lesson 4 teaches you how to use enumerables and callable to simply express powerful concepts built on standard Ruby APIs.

Lesson 5: The Standard Library

In Lesson 5 you thoroughly explore the Ruby standard library and learn how to use the library to improve your writing of applications.

About LiveLessons Video Training

The LiveLessons Video Training series publishes hundreds of hands-on, expert-led video tutorials covering a wide selection of technology topics designed to teach you the skills you need to succeed. This professional and personal technology video series features world-leading author instructors published by your trusted technology brands: Addison-Wesley, Cisco Press, IBM Press, Pearson IT Certification, Prentice Hall, Sams, and Que. Topics include: IT Certification, Programming, Web Development, Mobile Development, Home and Office Technologies, Business and Management, and more. View all LiveLessons on InformIT at: http://www.informit.com/livelessons.

Table of contents

  1. Introduction
    1. Effective Ruby LiveLessons: Introduction
  2. Lesson 1: Arrays and Hashes
    1. Learning Objectives
    2. Item 1 Duplicate collections you receive as arguments
    3. Item 2 Use Set for efficient presence checks
    4. Item 3 Consider using a default hash value
    5. Item 4 Use Hash#fetch over Hash#[]
    6. Item 5 Prefer decorating collections
  3. Lesson 2: Seams
    1. Learning Objectives
    2. Item 6 Avoid using class variables
    3. Item 7 Avoid using class methods
    4. Item 8 Obey the Law of Demeter
    5. Item 9 Prefer methods over instance variables
    6. Item 10 Prefer methods over constants
    7. Item 11 Use the === protocol for matching tasks
  4. Lesson 3: Testing
    1. Learning Objectives
    2. Item 12 Use only one assertion or expectation per test
    3. Item 13 Order your tests with the arrange, act, and assert pattern
    4. Item 14 Run your tests in a random order
    5. Item 15 Prefer spies to mocks or stubs
    6. Item 16 Use Rack::Test for integration testing
  5. Lesson 4: Enumerables and Callables
    1. Learning Objectives
    2. Item 17 Prefer enumerable methods
    3. Item 17.1 Use zip and each_with_index
    4. Item 17.2 Use each_slice and each_con
    5. Item 17.3 Use partition, select, and find
    6. Item 17.4 Use group_by, reduce, and each_with_object
    7. Item 17.5 Implement your own enumerable
    8. Item 18 Prefer lambda instead of proc
    9. Item 19 Use Symbol#to_proc where appropriate
    10. Item 20 Use #method to pass instance methods as callables
    11. Item 21 Use {} for blocks that return and do..end for blocks that mutate
  6. Lesson 5: The Standard Library
    1. Learning Objectives
    2. Item 22 Use block forms for IO
    3. Item 23 Understand the difference between Time, DateTime, and Date
    4. Item 24 Do HTTP requests with Net::HTTP
    5. Item 25 Prefer file methods over manual path manipulation
    6. Item 25.1 Use #absolute_path, #dirname, and __FILE__ to be OS independent
    7. Item 25.2 Use File.extname to determine file type
    8. Item 25.3 Use File.join to build file paths safely
  7. Summary
    1. Effective Ruby LiveLessons: Summary

Product information

  • Title: Effective Ruby
  • Author(s):
  • Release date: July 2015
  • Publisher(s): Pearson
  • ISBN: 0134175417