3 ms·
> For beginners, almost anything will be hurdle till the get the hang of it. Afterwards, they'll be practitioners. Being a beginner is a temporary situation; pr
by nickjj 6y ago
> For beginners, almost anything will be hurdle till the get the hang of it. Afterwards, they'll be practitioners. Being a beginner is a temporary situation; practitioners are forever.
What about languages who support multiple ways to do something in a semi-inconsistent manner?
For example with Elixir, in a lot of cases you end up calling certain standard library functions like foo(hello: :world) while others are foo(:hello, :world). Now, there's special magic happening in the first case but stuff like this is super confusing and it gets easily compounded with more complex examples.
As a beginner I found Ecto's various ways to calls things super confusing and I had to reference examples almost all the time to get the syntax right (which often had multiple ways of being "right"), but I've also talked with more experienced Elixir developers and they get hung up with Ecto's syntax too.
So where do you draw the line between making the language / DSL better and keeping it catered to only folks who are basically at the same skill level of the language creator?
- czynskee 6y agoI had (have) the same experience with Ecto but Ecto != Elixir. One of the super cool things about Elixir is how easy it is to extend the language with DSLs. However (and Jose et al are very up front about this), the more DSLs and macros you use, the more confusing it's going to be. Using macros is a tradeoff because it can be a very neat solution but it also obscures what the code is doing quite a bit. Re. foo(hello: :world) vs foo(:hello, :world) - that one I got the hang of more quickly, though I'll admit it's confusing at first. In the first you're providing a keyword list (which is merely a list of 2-membered tuples where the first member of the tuple is an atom). And when a keyword list is the last (or only) argument to a function it can be provided without the brackets. So the same thing could be written as foo([{hello:, :world}]) or also foo([hello: :world]). In foo(:hello, :world) you're just providing arguments. When you're first learning the language this can definitely trip you up but I think once you become a "practitioner" it's not too bad and ends up being pretty nice. God Elixir is so cool.
- the_af 6y ago> What about languages who support multiple ways to do something in a semi-inconsistent manner? They seem like a good thing to me! The aim is never to make things difficult for beginners on purpose. The point is that making things less confusing for beginners is not worthwhile if it comes at the cost of making things more cumbersome for practitioners.
- the_af 6y agoAddendum: I completely misread the comment I was replying to. My comment "they seem like a good thing to me" makes no sense. Please disregard. Unfortunately, I cannot delete it now. I actually agree with the comment which states "But that's not really a beginner-specific problem. Even practitioners will likely find it to be a nuisance."
- wtetzner 6y ago> What about languages who support multiple ways to do something in a semi-inconsistent manner? But that's not really a beginner-specific problem. Even practitioners will likely find it to be a nuisance.