DEV Community

Carlos Castaneda
Carlos Castaneda

Posted on

TIL Blog Day 6 - Ruby Classes

Today I was able to finish the Codecademy Ruby module. It ended with an introduction to classes in Ruby. Before Tech Prep I had studied JavaScript and that was my only exposure to classes. This previous exposure to classes has provided me with a solid foundation for grasping the intricacies of Ruby's class system.

The biggest difference between Ruby classes and JavaScript classes is that Ruby provides built-in access control for class methods and instance methods using public, private, and protected keywords.

JavaScript, on the other hand, doesn't have built-in access control. Conventionally, developers use naming conventions (like prepending an underscore _) to indicate private members, but these are not strictly enforced by the language itself.

Overall I am liking the simplicity of Ruby. Tomorrow I will tackle the Intro to Ruby modules and keep reading my Ruby book.

Top comments (0)