|
Low Level Features of Ruby:
- Types and scope - You can use variables in your ruby programs without
any declarations. Variables in ruby can contain data of any type. Variable
name itself denotes its scope:
| Local |
name |
| Global |
$name |
| Instance |
@name |
| Class Variable |
@@name |
| Constant / Class Name |
Name |
Variables in Ruby have no type. They behave as placeholders, but data is typed.
Ruby checks the type at runtime. You do not have to declare variables, because
they are automatically created when you use them.
- Memory management - Ruby has automatic memory management. Objects
no longer referenced from anywhere are automatically collected by the garbage
collector built in the interpreter. This cuts down memory leaks, reduces crashes,
and makes programming easier - at the cost of some speed.
- Dynamic features- Ruby features a true mark-and-sweep garbage collector.
It works with all Ruby objects.
|