Jump to ratings and reviews
Rate this book

Ruby для дітей. Магічний вступ до програмування

Rate this book
Ви готові освоїти нову мову програмування? Проста у вивченні, цікава у використанні мова програмування Ruby ідеально підходить для початківців. У цій книжці Ruby запрошує вас у фантастичну подорож разом із веселими героями і справжніми чарівниками. Вирушайте у фантастичні пригоди разом з Рубеном і Скарлет, й здобудете практичні навики у програмуванні, а саме навчитеся: використовувати базові поняття у програмуванні, такі як змінні, символи, масиви та текстові рядки; працювати з асоціативними масивами в Ruby, аби створити власне меню сніданку; керувати потоком виконання коду за допомогою циклів та умовних операторів, щоби допомогти королівському сантехнікові; перевіряти свої шалені ідеї в IRB та зберігати свої програми у якості скриптів.

По дорозі зустрінете дивовижних персонажів із справжнього Королівства: королеву-хакерку, Майже білу лицарку та менестреля-мандрівника. Ваше завдання — освоїти важливі навички, створювати цікаві речі і пишатися собою!

392 pages, Hardcover

First published June 22, 2014

17 people are currently reading
112 people want to read

About the author

Eric Weinstein

6 books13 followers
Eric Weinstein earned his AB in English literature and philosophy from Duke University, his MFA from New York University, and his MS in computer science from the Georgia Institute of Technology. His poems have appeared in McSweeney's The Believer, The New Yorker, Ploughshares, The Yale Review, and others.

His programming guide for children, Ruby Wizardry, is available from No Starch Press; his poetry chapbook, Vivisection, is available from New Michigan Press. He lives in Los Angeles.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
15 (41%)
4 stars
13 (36%)
3 stars
4 (11%)
2 stars
2 (5%)
1 star
2 (5%)
Displaying 1 - 11 of 11 reviews
Profile Image for Michael Larsen.
21 reviews11 followers
March 5, 2015
My daughter and I are exploring books as we take on a project of learning how to write code and test software. Part of that process has been to spend time in the "code and see" environment that is Codecademy. If you have done any part of the Ruby track on Codecademy, you are familiar with Eric Weinstein’s work, as he’s the one who wrote and does updates to the Ruby section (as well as the Python, JavaScript, HTML/CSS and PHP modules).

With "Ruby Wizardry", Eric takes his coding skills and puts them into the sphere of helping kids get excited about coding, and in particular, excited about coding in Ruby. Of all the languages my daughter and I are covering, Ruby is the one I’ve had the most familiarity with, as well as the most extended interaction, so I was excited to get into this book and see how it would measure up, both as a primer for kids and for adults. So how does Ruby Wizardry do on that front?

As you might guess from the title and the cover, this book is aimed squarely at kids, and it covers the topics by telling a story of two children in a magical land dealing with a King and a Court that is not entirely what it seems, and next to nothing seems to work. To remedy this, the children of the story have to learn some magic to help make the kingdom work properly. What Magic, you ask? Why the Ruby kind, of course :).

Chapter 1 basically sets the stage and reminds us why we bought this book in the first place. It introduces us to the language by showing us how to get it ("all adults on deck!”), how to install it, make sure it’s running and write our first "Hello World” program. It also introduces us to irb, our command interpreter, and sets the stage for further creative bouts of genius.

Chapter 2 looks at "The King's Strings" and handles, well, strings. Strings have methods, which allow us to append words like length and reverse written with dots ("string".length or 'string'.reverse). Variables are also covered, and show that the syntax that works on raw strings also works on assigned variables as well.

Chapter 3 is all about Pipe Dreams, or put more typically, flow control, with a healthy dose of booleans, string interpolation, and the use of structures like if, elseif, else and unless to make our ruby scripts act one way or another based on values in variables and how those values relate to other things (such as being equal, not equal, done along with other things or in spite of other things, etc.).

Chapter 4 introduces us to a monorail, which is a train that ravels in an endless loop. Likewise, the chapter is about looping constructs and how we can construct loops (using while as long as something is true and until up to the point something becomes false, along with for to iterate over things like arrays) to do important processes and repeat them as many times as we want, or need. Also, it warns us to not write our code in such a way to make an infinite loop, one that will just keep running, like our monorail if it never stops.

Chapter 5 introduces us to the hash, which is a list with two attributes, a key and a value, as well as the ability to add items to arrays with shift, unshift, push or pop. additionally we also learned how to play with range methods and other methods that give us insights as to how elements in both arrays and hashes can be accessed and displayed.

Chapter 6 goes into talking about symbols (which is just another word for name), and the notation needed to access symbols. Generally, the content of something is a string; the name of something is a symbol. Utilizing methods allows us to change values, convert symbols to strings, and other options that allow us to manipulate data and variables.

Chapter 7 goes into how to define and create our own methods, including the use of splat (*) parameters, that allows us to use any number of arguments. We can also define methods that take blocks by using "yield".

Chapter 8 extends us into objects, and how we can create them and use them. We also learn about object IDs to tell them apart, as well as classes, which allow us to make objects with similar attributes. We also see how we can have variables with different levels of focus (Local, Global, Instance and Class) and how we can tell each apart (variable, $variable, @variable and @@variable, respectively).

Chapter 9 focuses on inheritance, which is how ruby classes can share information with each other. this inheritance option allows us to create subclasses and child classes, and inherit attributes from parent/superclasses.

Chapter 10 shows us a horse of a different color, or in this case, modules, which are a bit like classes, but they can't be created using the new method. Modules are somewhat like storage containers so that we can organize code if methods, objects or classes won't do what we want to do. By using include or extend, we can add the module to existing instances or classes.

Chapter 11 shows us that sometimes the second time's the charm, or more specifically, we start getting the hang of Refactoring. Using or operators to assign variables, using ternary operators for short actions, using case statements instead of multiple if/elseif/else statements, returning boolean variables, and most important, the removal of duplicate code and making methods small and manageable.

Chapter 12 shows us the nitty-gritty of dealing with files. Opening reading from, writing to, closing and deleting files are all critical if we want to actually save the work we do and the changes we make.

Chapter 13 encourages us to follow the WEBrick Road, or how we can use Ruby to read and write data from the Internet to files or back to Internet servers using the open-uri gem, which is a set of files that we can use to make writing programs easier (and there are lots of ruby gems out there :) ).

Chapter 14 gives some hints as to where you, dear reader, might want to go next. This section includes a list of books, online tutorials, and podcasts, including one of my favorite, the Ruby Rogues Podcast. It also includes interactive resources such as Codecademy, Code School, and Ruby Koans, and a quick list of additional topics.

The book ends with two appendices that talk about how to install Ruby on a mac or a Linux workstation and some of the issues you might encounter in the process.

Bottom Line:

For a "kids book", there's a lot of meat in here, and to get through all of the examples, you'll need to take some time and see how everything fits together. The story is engaging and provides the context needed for the examples to make sense, and each section provides a review so that you can really see if you get the ideas. While aimed for kids, adults would be well suited to follow along as well. Who knows, some wizarding kids might teach you a thing or three about Ruby, and frankly, that's not a bad deal at all!
Profile Image for Eric Mesa.
840 reviews26 followers
September 26, 2020
This year one of my goals was to learn a new programming language. Ruby is supposed to be pretty easy for beginners so I figured it'd probably end up being a snap for someone like me who's been programming for a while. The only book I happened to already own was this kids' book that I had bought for my kids. They haven't yet wanted to use it (although they've gotten into Scratch)k but it worked fine for me. Indeed it was, and I couldn't help making comparisons between Ruby and Python the whole time. The two languages are incredibly similar. Ruby clearly seems to be inspired by Perl, but is still a lot more readable as almost plain English. (Although some of the shortcut refactorings can be pretty hard to get if you're not a Ruby person)

So what about the book? I've come away convinced that for nearly any kids' programming book, a story format is a wonderful way to teach programming. It's doesn't feel like a textbook and it gives the student some useful (if fanciful) problems that can be solved by the code. Frankly, I wouldn't mind an adult programming book with a story as a framing device. I wonder if there's a way to do it without being tongue-in-cheek, though. The only other type of programming book that I really love for a first-timer is a project-based book. That shows you real code. It's the difference between the new "conversational" approaches to learning human languages vs the phrase-book learning from when I was a kid (eg "¿Donde esta la biblioteca?" Great for all those times you go to another country to go to the library....)

If you have anyone young (or young at heart) in your life who is old enough to read and type on the computer, I think this is a GREAT first programming book. And, since my entire career has been programming and managing programmers, let me assure you that if you learn programming principles in any language - it's transferable to any other.
Profile Image for Jolien.
728 reviews147 followers
September 24, 2015
Review on my blog The Fictional Reader

As with JavaScript for Kids, I had no previous knowledge about programming and Ruby. I don’t think I’d ever used it and I sure didn’t know where to start. Ruby Wizardry is an amazing beginner’s guide to programming for kids. I do feel like this is much more kid-friendly than JavaScript for Kids. You’re taught how to work with Ruby through use of a story.

It starts with these two kids who help the King find his string necklace, which is where you learn about strings. Then a pipe in his castle bursts. Then you use a train to go to a breakfast restaurant and the train is stuck in a loop. Every single time they encounter a problem, which they then solve with use of Ruby. It’s a really interesting way to learn, because it keeps you -especially kids- involved in the story. And at the end of every chapter, they revise what you’ve learned so far.

This is a really kid-friendly way of learning, and it’s a thorough guide as well! I truly learned a lot while going through this. It also gives you links if you need to download something and helps you start up Ruby. If you ever want to teach your kids how to program, I feel like this would be the perfect way!

★★★ ½
Profile Image for Gretl Wagner.
4 reviews30 followers
February 25, 2015
Oh no! The King has lost his string! Ruben and Scarlet, kid Ruby masters, find it and teach all about strings along the way.But after rectifying the situation, they return to the King's study, only to find it waist deep in water! Someone has been changing the code for the Mysterious Pipe, setting its boolean incorrectly. This gives a nice opportunity to be educated on the properties of booleans. Next the King, Scarlet and Ruben must fix a train, several cooking machines, find a Dagron and more. As they journey about the kingdom, fixing and learning code, they begin to find evidence that someone has been ruining code on purpose! Can Scarlet, Ruben, and the King catch the culprits before they escape?
This is a simple, easy to understand introduction to Ruby, one of the easiest programming languages. The plot is a tool used to introduce programming concepts, such as while and for loops, if/else/elsif, arrays, and others. Easy to understand explanations are followed with fun projects. I recommend this book for children 10+ who are interested in coding in a simple language.
Profile Image for Cody.
598 reviews50 followers
Read
September 12, 2019
Not just for kids! I read this in preparation for a software engineering bootcamp, and it was a great primer not just for Ruby but for learning how to program in general. Clear, concise, and light-hearted.
27 reviews
June 15, 2022
Малий придбав собі цю книгу. Мені ж стало цікаво, наскільки відрізняються сучасні книги для маленьких програмістів від тих що стали ми 30 років назад. І що ж, як на мене класна книга, із вкладеними в сюжет завданнями. Звичайно після неї потрібно щось більш проектно-орієнтоване. А цій я поставлю додаткову зірку за гадюк, ой... піт...
Profile Image for Cees Timmerman.
81 reviews38 followers
September 12, 2018
80% repetitive fluff, which wouldn't be so bad if it wasn't so easy to simply read the preceding page again. I much prefer the more consise and in-depth "How to Think like a Computer Scientist" books.
1 review
October 21, 2017
Written for kids but it was a fun, whimsical intro to Ruby. :-)
Profile Image for Daniel.
2,761 reviews41 followers
April 15, 2016
This review originally published in Looking For a Good Book. Rated 3.0 of 5

Though I have a better than rudimentary knowledge of some basic computer languages (HTML, PHP, JAVASCRIPT) I will admit that I'd never even heard of Ruby before, so I was definitely curious to check this one out. I reviewed a companion book, Javascript For Kids here.

As the subtitle says, and as the drawing on the cover indicates, this book is written for kids. Or at least for people trying to learn something on a very rudimentary level.

I suspect that for that fifth or sixth grader, interested in computers and with enough interest in computers, this might be just the right way to explain it. Author Eric Weinstein approaches this by telling a fantasy story and correlating the needs of the characters in the story with the needs of the Ruby programming language. It is a very clever means of teaching and I can easily see this as a series of classroom lessons.

Weinstein also does a nice job of building on each chapter, taking the young developer through the process and learning the important steps - syntax, strings, if, elseif, else, loops, arrays, and so on.

Whereas the Javascript for Kids was really helpful and a book that I was able to read and use, I found this story-telling method a bit much for me. I grew impatient and just wanted the Ruby lesson. I didn't want to read a story, I wanted to learn how to program with Ruby.

I am not a teacher, however, and my own children are likely beyond this level of learning, so it's very difficult for me to say how it would go over with the target audience. I think it would work well and would want to see this available in my local library.

Looking for a good book? Ruby Wizardry by Eric Weinstein is a software programming book for children, told through a fantasy narrative, with some good lessons in the Ruby language.

I received a digital copy of this book from the publisher, through Edelweiss, in exchange for an honest review.
Displaying 1 - 11 of 11 reviews

Can't find what you're looking for?

Get help and learn more about the design.