With this blog, I would like to tell you more about this programming language, its history, uses, and advantages and disadvantages for programmers, as well as share top resources on learning Ruby and Ruby development. Ruby is a programming language, which is dynamic, object-oriented and reflective. It was designed and developed by Yukihiro Matsumoto. Having first appeared 21 years ago, in the year 1995, it had its most recent version 2.3.0 released in December 2015, just about two months ago.
The creators of Ruby admitted that it follows the principles of good user interface design. In fact, they hope to enhance programmers’ productivity with fun elements in the process. The programming language is more oriented towards what human users need from a design, rather than what computers and machines want.
The principle Ruby follows is called POLA, principle of least astonishment. Amateur users might think that POLA refers to having fewer amount of differences between Ruby and other programming languages. In fact, the principle stresses out the importance of minimizing the confusion of the experienced users of the language. Matsumoto, the creator of Ruby wanted it to become the language that he himself will enjoy using and that the other programmers would consider fun as well.
The features of Ruby include duck and dynamic typing, default arguments, cooperative fibers and native threads, exception handling, garbage collection, strict Boolean rules, facilitation of met programming, code embed in strings, custom dispatch behavior, lexical generators, closures, and iterators. The language also contains notation for symbols, arrays, and regular expressions, operator overloading, implementation on all major platforms, large library, with modules for JSON, YAML, OpenSSL, FTP, HTTP, Tk, XML, CGI, RSS, zlib, and curses, and variable scope defined by four levels: instance, class, local and global.
Many programming languages define some elements, classes and instances, such as Booleans, integers or “null”, as primitives. Ruby, however, is object-oriented and it treats every value as an object. All variables in Ruby have connections to objects. There are methods that are called on an object, and those methods are functions. Ruby is interestingly multi-paradigm: it combines functional programming with procedural programming, supporting metaprogramming, reflection and introspection.
Ruby’s syntax somehow reminds of other languages, such as Perl and Python. Keywords signal definitions of classes and methods, and the blocks of the code can be signalized by either keywords or braces. Expression and statement is the same thing in Ruby, and it is recommended to use a line break at the end of a statement or an expression. Identifiers have to be capitalized because the syntax is case-sensitive. When variables are capitalized, Ruby treats them as constants. When using floating point literals, you have to surround the decimal point with digits on both sides; otherwise, the language will not recognize them as floating point literals.
Ruby can seem strict, especially in terms of its syntax, but it is easy to learn and fun to use. If you are interested in this programming language, read other posts in my blog to find more information about it.