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 at runtime
  • In Ruby, everything is a class, except for nil. However, nil is an object of NilClass

Dynamic Type vs Static Type

  • Dynamic Type-checking Languages: Python, Ruby, JavaScript, PHP, Perl, Objective-C
    • Types are checked at run-time
  • Static Type-checking Languages: C, Java, Rust, TypeScript, Swift, Kotlin
    • Types are checked at compile time

Explicit Typing vs Implicit Typing

  • Ruby uses latent or implicit typing where you don't have to declare the type of a variable.
    • Latent is not the same as dynamic typing
  • In contrast manifest or explicit typing where explicitly declare the type of any variable we create. Suchas as: C, TypeScript
    • Manifest is not the same as static typing