Information Technology Reference
In-Depth Information
Chapter 3. Ruby and Chef Syntax
As briefly discussed in Chapter 2 , both the Chef Development Kit and Chef Client are writ-
ten and implemented in Ruby. However, prior experience with Ruby is not a requirement for
writing Chef code. Most people who use Chef have no prior experience with the Ruby pro-
gramming language. So let's spend some time going over the basics of Ruby and how it
relates to Chef syntax.
Overview of Ruby
Ruby is an object-oriented programming language that was originally designed in 1993 as a
replacement for Perl. Yukihiro Matsumoto (or “Matz” for short) designed and created Ruby
in Japan. Ruby became very popular in the United States after two things occurred: 1) Dave
Thomas wrote the topic “Programming Ruby” in English in 2000, as until then most of the
documentation on Ruby was in Japanese, and 2) David Heinemeier Hansson created the
Ruby on Rails framework in 2003, which came to be viewed as an incredibly productive way
to build web applications. The rapid adoption of Ruby on Rails, along with great documenta-
tion written in English, led people outside Japan to appreciate the Ruby language for other
purposes besides web development. As illustrated in the next section, Ruby boasts a very
English-like syntax.
Although Ruby is object oriented, it also supports functional and imperative programming
paradigms. Unlike C or Java, which implement static typing, Ruby is a dynamically typed
language. In this way, Ruby is similar to Python and Lisp. Ruby is designed for programmer
productivity and fun. Usability and interface design are often given preference over speed or
concurrency:
Often people, especially computer engineers, focus on the machines. They think, “By doing this,
the machine will run faster. By doing this, the machine will run more effectively. By doing this,
the machine will something something something.” They are focusing on machines. But in fact
we need to focus on humans, on how humans care about doing programming or operating the
application of the machines. We are the masters. They are the slaves.
— Yukihiro Matsumoto
Search WWH ::




Custom Search