Ruby (programming language) facts for kids
![]() |
|
Paradigm | multi-paradigm: object-oriented, imperative, functional, reflective |
---|---|
Designed by | Yukihiro Matsumoto |
Developer | Yukihiro Matsumoto, et al. |
First appeared | 1995 |
Stable release |
2.3.1 / April 26, 2016
|
Typing discipline | duck, dynamic |
Scope | lexical, sometimes dynamic |
OS | Cross-platform |
License | Ruby License or BSD License |
Filename extensions | .rb, .rbw |
Major implementations | |
Ruby MRI, YARV, Rubinius, MagLev, JRuby, MacRuby, RubyMotion, HotRuby, IronRuby, mruby | |
Influenced by | |
Ada, C++, CLU, Dylan, Eiffel, Lisp, Perl, Python, Smalltalk | |
Influenced | |
D, Elixir, Falcon, Fancy, Groovy, Ioke, Mirah, Nu, Reia | |
|
Ruby is a special kind of language that computers understand. It's called a programming language. You use it to write instructions that tell a computer what to do.
A person named Yukihiro "Matz" Matsumoto created Ruby. He made it in Japan in the mid-1990s. Many people like Ruby because it's designed to be easy and fun to use.
Contents
What Makes Ruby Special?
Ruby is popular because it has some cool features. It's designed to be simple and powerful.
- Looks like English: Ruby code often looks a lot like regular English sentences. This makes it easier for people to read and understand.
- Terse: This means you can write powerful commands using only a few lines of code. It's short, but still clear.
- Dynamic: You can easily change how Ruby programs work, even while they are running. This gives programmers a lot of flexibility.
- Duck Typing: This is a fun idea! It means if something acts like a duck (walks like a duck, quacks like a duck), then you can treat it as a duck. In programming, if an object can do what you need, it doesn't matter exactly what type of object it is.
How Ruby Works
Ruby is a multi-paradigm language. This means you can use different styles of programming with it.
- Object-Oriented: In Ruby, almost everything is an "object." Objects are like little bundles of data and actions. This makes it easy to organize your code.
- Imperative: You can write step-by-step instructions for the computer to follow.
- Functional: You can also write code using functions, which are like mini-programs that do specific tasks.
Ruby is also a reflective language. This means a Ruby program can look at its own code and even change itself while it's running!
Example Code
Here is a simple example of a Ruby program. This program is called "Hello World!" It's often the first program people learn to write.
puts "Hello World!"
This one line of code tells the computer to display the words "Hello World!" on the screen. The word `puts` means "put string" or "print."
Who Uses Ruby?
Ruby is used for many different things. It's very popular for building websites, especially with a tool called Ruby on Rails. Many big companies and startups use Ruby for their web applications. It's also used for creating tools, games, and other software.
Images for kids
See also
In Spanish: Ruby para niños