We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
Understanding Elixir Modules: Namespaces or Classes?
201
clicks
Source: reddit.com
The content presents a query by the author, magingax, who is trying to understand the nature of modules in Elixir. They have likened modules to namespaces, as it is common to consider them in many programming languages. However, the author's confusion arises from the ability to use 'defstruct' within a module to create instances, which is a characteristic often associated with classes in object-oriented programming (OOP). This raises the question of whether Elixir modules should be thought of as classes, given that they can encapsulate both state (through 'defstruct') and behavior (with functions).
Related posts
© HashMerge 2024