Ruby
Intro to Ruby, an oriented programming language with similar syntax to Python.
Ruby is a programming language (focused on OOP) similar to Python syntax.
Features:
- Ruby does not use a compiler
- Uses
dynamic type-checking
. That is, data type is determined atruntime
- In Ruby, everything is a class, except for
nil
. However,nil
is an object ofNilClass
Dynamic Type vs Static Type
- Dynamic Type-checking Languages: Python, Ruby, JavaScript, PHP, Perl, Objective-C
- Types are checked at
run-time
- Types are checked at
- Static Type-checking Languages: C, Java, Rust, TypeScript, Swift, Kotlin
- Types are checked at
compile time
- Types are checked at
Explicit Typing vs Implicit Typing
- Ruby uses
latent
orimplicit typing
where you don't have to declare the type of a variable.Latent
is not the same asdynamic typing
- In contrast
manifest
orexplicit typing
where explicitly declare the type of any variable we create. Suchas as: C, TypeScriptManifest
is not the same asstatic typing