The book “Head First. Learning Ruby »

    Hi, habrozhiteli! We have translated another O'Reilly book:

    imageAre you curious why literally everyone around us has started talking about Ruby? Ask yourself bluntly: do you like working efficiently? Do the numerous compilers, libraries, classes that other programming languages ​​load you bring you closer to solving a specific problem, the admiration of colleagues and the crowd of happy customers? Do you want the programming language to do the technical details in your place? Then give up routine and start solving specific problems, and Ruby will do the rest for you.

    Like all books in the Head First series, Learning Ruby takes an active approach to learning, going beyond dry, abstract explanations and guides. You will not only learn the Ruby language, but also help your programmer star shine brightly in the sky. You will learn the basics of the language and advanced Ruby features such as blocks, objects, methods, classes, and regular expressions. As your skills improve, tasks will become more complex and you will move on to topics such as exception handling, modules, mixed classes, and metaprogramming.

    Who is this book written for?

    If you answer “yes” to all of the following questions ...
    1. Do you have a computer with a text editor?
    2. Do you want to learn a programming language with which the development process becomes simple and productive?
    3. Do you prefer lively conversation to dry, boring academic lectures?

    ... then this book is for you.

    Who is this book not suitable for?
    If you answer “yes” to any of the following questions:
    1. Do you absolutely not understand computers? (It is not necessary to be a specialist, but you must understand what files and folders are, be able to run a terminal application and use a simple text editor.)
    2. Are you a super-duper developer who needs a reference?
    3. Are you afraid to try something new? Would you rather go to the dentist than wear a striped and checkered one? Do you think that a technical book in which inheritance is explained using armadillos as an example cannot be serious?

    ... this book is not for you.

    Here's what WE did:

    We used drawings because the brain is better suited to the perception of graphics than text. From a brain perspective, drawing is worth a thousand words. And when the text is combined with graphics, we embed the text directly in the drawings, because the brain works more efficiently.

    We use redundancy : we repeat the same thing several times, using different means of transmitting information, we turn to different feelings - and all to increase the likelihood that the material will be encoded in several areas of your brain.

    We use concepts and drawings in a somewhat unexpected way, because the brain is better at perceiving new information. In addition, drawings and ideas usually have emotionalcontent because the brain pays attention to the biochemistry of emotions. What makes us feel is better remembered - be it a joke , surprise, or interest .

    We use the conversational style , because the brain perceives information better when you participate in a conversation, rather than passively listening to a lecture. This also happens when reading.

    The book includes numerous exercises , because the brain remembers better when you do something. We tried to make them difficult, but interesting - something that most readers prefer.

    We combined several styleslearning, because some readers prefer step-by-step descriptions, others tend to first introduce the "big picture", and the third is enough code. Regardless of your personal preferences, it is useful to see several options for presenting one material.

    We tried to engage both hemispheres of your brain ; this increases the likelihood of assimilation of the material. While one side of the brain is working, the other often has the opportunity to rest; this increases the effectiveness of training for a long time.

    The book also includes stories and exercises that reflect other points of view . The brain absorbs information deeper when it has to evaluate and make judgments.

    There are often questions in the book., to which it is not always possible to give a simple answer, because the brain learns faster and remembers when it has to do something. It’s impossible to build muscle by watching others do it. However, we made sure that the efforts of readers were put in the right direction. You do not have to puzzle over obscure examples or understand complex, oversaturated technical jargon or too concise text. People are

    used in stories, examples, in pictures - because you are also a person . And your brain pays more attention to people than to inanimate objects .


    This is a textbook, not a reference. We intentionally removed from the book everything that could interfere with the study of the material on which you are working. And at the first reading of the book, one should start from the very beginning, because the book assumes that the reader has certain knowledge and experience.

    A little programming experience in another language will not hurt .
    Many developers switch to Ruby after a different programming language (often trying to stay away from this language). The material is presented at a level understandable even for a beginner, but we do not talk in detail about what a variable is and how the if command works. It will be easier for you if you are at least in general terms presenting these topics.

    We are not trying to describe each class, library, and method in detail.
    There are many built-in classes and methods in Ruby. Of course, all of them are of interest, but we would not be able to consider them even in a book of twice as much volume. Our focus will be on the main classes and methods that are important to you, the novice developer. We will make sure that you understand their essence well and feel confident enough about when and how to use them. In any case, after reading the book, you can take any reference book and quickly find information about all classes and methods that are not considered in the book.

    Exercises MANDATORY.
    Exercises are part of the main material of the book. Some exercises help to memorize the material, others help to better understand it, while others are focused on its practical application. Do not skip exercises.

    Repetition is applied intentionally.
    The books of this series have one fundamental feature: we want you to really understand the material well. And so that you remember everything you learned. Most reference books do not set as their goal successful memorization, but this is not a reference book, but a textbook, therefore some concepts are stated several times in the book.

    Examples were made as compact as possible.
    Our readers do not like to look at 200 lines of code in the examples to find two really important lines. Most examples of the book are given in the smallest possible context so that the part you are studying is simple and intuitive. Do not expect that all examples will be error-proof, or at least complete - they are written for educational purposes and do not always have full functionality.

    All sample files are available for download on the Internet. You will find them at .


    Jay McGavren was automating a hotel services company when a colleague showed him the book Programming Perl (the so-called “book with a camel”). Jay instantly became a fan of Perl because he liked writing code without waiting for a development team of 10 to set up the build system. At the same time, he had the crazy idea of ​​someday writing a technical book himself.

    In 2007, when the development of Perl came to a standstill, Jay began to search for a new interpreted language. Ruby won - thanks to its strong
    object orientation, excellent support and incredible flexibility. Since then, he used Ruby to work on two gaming
    libraries, in a project in the field of art, and also engaged in independent development using Ruby on Rails. Since 2011, he has been working in the field of online developer training.

    You can read Jay on Twitter at or visit his personal website .

    You can familiarize yourself with the book in more detail on the website of the publishing house.
    Table of contents

    For Habrozhitelami 25% off coupon - Ruby

    Also popular now: