You missed the point I tried to make on my answer, I was trying to point you are not asking a good enough question, and you will clearly not get a good enough answer.
You tried to clarify saying why does this piece of syntax exist in elixir and not in other languages, which is still not a good question, but let's elaborate.
Briefly let's take Ruby as an example as Elixir takes heavy inspiration from Ruby in terms of syntax. In ruby we have a module macro, so you can do something like
moduleDogdeftalkputs"Woof!"endend
Same code in Elixir would be fairly similar minor difference, now if what you are actually trying to get at is that you want an explanation of what a module is and how is used, thats a very different thing:
Modules are similar to classes in other languages, and are used to structure code cleanly; defmodule is just a language macro for defining a module.
I would strong recommend going through elixirschool.com/en/lessons/basics... from scratch if you are fairly new to the language or programming in general.
Muhammed,
You missed the point I tried to make on my answer, I was trying to point you are not asking a good enough question, and you will clearly not get a good enough answer.
You tried to clarify saying why does this piece of syntax exist in elixir and not in other languages, which is still not a good question, but let's elaborate.
Briefly let's take Ruby as an example as Elixir takes heavy inspiration from Ruby in terms of syntax. In ruby we have a module macro, so you can do something like
Same code in Elixir would be fairly similar minor difference, now if what you are actually trying to get at is that you want an explanation of what a module is and how is used, thats a very different thing:
Modules are similar to classes in other languages, and are used to structure code cleanly;
defmodule
is just a language macro for defining a module.I would strong recommend going through elixirschool.com/en/lessons/basics... from scratch if you are fairly new to the language or programming in general.
I'll start soon to Elixir, btw thanks.