automatic memory-management (garbage collection)
advanced OO-concepts and features
advantage:
disadvantage:
In Ruby everything is an object (as in Smalltalk). Ruby did not use multiple-inheritance, but the same is possible through mix-in.
Ruby is highly portable, so that one and the same Ruby program runs without changes under UNIX, Windows, DOS, Mac, BeOS and others. Of course that's only true unless using platform-specific modules, like for example some GUI's for UNIX or WinGKR (Win32 GUI Kit for Ruby).
advantage:
Variables in Ruby have no type, such as in Smalltalk, BASIC or Python. Variables behave as placeholders, but data is typed. In C++ or Pascal, variables are typed (e.g. int / Integer), but the data in the memory is not, that is you cannot recognize if it's a String or an Integer. In C++ or Pascal the types are checked at compile-time, whereas Ruby checks the type at runtime, so if the object understands the message (method-call) is first known after a method-call. You do not have to declare variables, because they are automatically created when you use them.
automatic memory-management (garbage collection)
You do not have to release allocated memory in Ruby (as you have to do in Pascal/C++ with dispose/free). No longer used memory, i.e. memory-frames where no variable points to, are automatically freed by the garbage collector.
advantage:
disadvantage:
Ruby is based among others on the syntax of Eiffel (Ada)
Ruby often offers an additional C++ similar syntax
advanced OO-concepts and features
Copyright (c) 1999 by Michael Neumann (neumann@s-direktnet.de) last update: 14.01.2001