Computer Science

Ruby programming language

Ruby is a high-level, interpreted programming language that is known for its simplicity and productivity. It is object-oriented and dynamically typed, making it easy to write and read code. Ruby is commonly used for web development, scripting, and automation.

Written by Perlego with AI-assistance

3 Key excerpts on "Ruby programming language"

  • Book cover image for: Programming Language Explorations
    • Ray Toal, Rachel Rivera, Alexander Schneider, Eileen Choe(Authors)
    • 2016(Publication Date)
    C H A P T E R 5 Ruby Ruby’s designer expressed his language’s purpose as follows: “I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language.” [80] First appeared 1995 Creator Yukihiro Matsumoto Notable versions 1.8 (2003) • 1.9 (2007) • 2.0 (2013) • 2.3 (2015) Recognized for OOP, Metaprogramming, DSL construction Notable uses Web servers, Scripting Tags Object-oriented, Expression-oriented, Dynamic Six words or less “A Programmer’s Best Friend” Yukihiro Matsumoto (Matz) designed Ruby in the mid-1990s as a language in which one could be productive and have fun programming. Rather than building a language with a small, simple core (for which Lisp and Smalltalk are famous), Matz looked to be pragmatic, and aimed for human-friendliness. He once told an interviewer: “I want to emphasize the how part: how we feel while programming. That’s Ruby’s main difference from other language designs. I emphasize the feeling, in particular, how I feel using Ruby. I didn’t work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be perfect for everyone. I tried to make Ruby perfect for me, but maybe it’s not perfect for you. The perfect language for Guido van Rossum is probably Python.” [122] But Ruby does have many, many fans, who find the language beautiful, powerful, and expressive. Of the many languages that influenced Ruby, two stand out. It’s a scripting language like Perl, with operating system interfaces, string processing, regular expressions, and various syntactic niceties like flexible quoting syntaxes. Ruby’s other major influence is Smalltalk. Ruby is object-oriented in the way Smalltalk is object-oriented, expressing nearly all computation with message passing. Ruby’s blocks come from Smalltalk, too. And the metaprogramming facilities of Ruby are, as in Smalltalk, an area in which the language really shines.
  • Book cover image for: Programming Language Explorations
    • Ray Toal, Rachel Rivera, Alexander Schneider, Eileen Choe(Authors)
    • 2016(Publication Date)
    CHAPTER 5
    Ruby
    Ruby’s designer expressed his language’s purpose as follows: “I hope to see Ruby help every programmer in the world to be productive, and to enjoy programming, and to be happy. That is the primary purpose of Ruby language.” [80 ]
    First appeared 1995
    Creator Yukihiro Matsumoto
    Notable versions 1.8 (2003) • 1.9 (2007) • 2.0 (2013) • 2.3 (2015)
    Recognized for OOP, Metaprogramming, DSL construction
    Notable uses Web servers, Scripting
    Tags Object-oriented, Expression-oriented, Dynamic
    Six words or less “A Programmer’s Best Friend”
    Yukihiro Matsumoto (Matz) designed Ruby in the mid-1990s as a language in which one could be productive and have fun programming. Rather than building a language with a small, simple core (for which Lisp and Smalltalk are famous), Matz looked to be pragmatic, and aimed for human-friendliness. He once told an interviewer: “I want to emphasize the how part: how we feel while programming. That’s Ruby’s main difference from other language designs. I emphasize the feeling, in particular, how I feel using Ruby. I didn’t work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be perfect for everyone. I tried to make Ruby perfect for me, but maybe it’s not perfect for you. The perfect language for Guido van Rossum is probably Python.” [122 ]
    But Ruby does have many, many fans, who find the language beautiful, powerful, and expressive. Of the many languages that influenced Ruby, two stand out. It’s a scripting language like Perl, with operating system interfaces, string processing, regular expressions, and various syntactic niceties like flexible quoting syntaxes. Ruby’s other major influence is Smalltalk. Ruby is object-oriented in the way Smalltalk is object-oriented, expressing nearly all computation with message passing. Ruby’s blocks come from Smalltalk, too. And the metaprogramming facilities of Ruby are, as in Smalltalk, an area in which the language really shines.
  • Book cover image for: The Ruby Workshop
    No longer available |Learn more

    The Ruby Workshop

    A New, Interactive Approach to Learning Ruby

    • Akshat Paul, Peter Philips, Dániel Szabó, Cheyne Wallace(Authors)
    • 2019(Publication Date)
    • Packt Publishing
      (Publisher)

    5. Object-Oriented programming with Ruby

    Overview
    By the end of this chapter you will be able to describe the basics of object-oriented programming using Ruby; model data with classes; implement instance and class variables in Ruby programs; write instance and class methods in application programs; and evaluate getters and setters in Ruby.

    Introduction

    In the previous chapter, we studied different methods and parameters of Ruby. We also learned about the built-in libraries of Math and Time in Ruby. It was here that we began to introduce the concepts of classes and modules. In this chapter, we will dive deeper into Ruby classes using object-oriented programming (OOP) concepts as our guide.
    OOP is where the rubber meets the road in programming. In other words, this is where the action happens. If you want to write a quick script or a full-fledged application, the chances are you will use OOP. OOP has the following benefits:
    • It is easy to design programs, as OOP concepts help greatly in the organization of concepts in everyday life.
    • It breaks hard problems down into manageable pieces for coding.
    • It is easy to test.
    • It is easy for others to read and learn how the program works.
    • It provides foundational units that can be easily extended or built upon, so as to construct robust applications.
    OOP facilitates writing code in a way that allows you to think about, and model, the concepts that you are working with in your program. For instance, imagine that you are tasked to write an application that allows all your coworkers to vote on who they think should be the employee of the month. You are most likely going to need code that deals with the abstract concepts in a voting system such as a user, a vote, and some code for grouping votes in a certain time period.
    This kind of thinking and modeling is also known as domain modeling. The problem domain is everything involved in trying to solve the problem. In the preceding case, the problem domain is an employee-of-the-month voting system. OOP is the tactical way of solving that problem by splitting our problem domain specifically into domain models using objects and classes.
Index pages curate the most relevant extracts from our library of academic textbooks. They’ve been created using an in-house natural language model (NLM), each adding context and meaning to key research topics.