News for hackers. Stuff that matters.
Re:Thoughts on Elixir, Phoenix and LiveView after 18 months ... by jitter_ on Monday August 14, 2023 @05:09AM (#37118958)
I'm not here to pick a side. I'm sure all of us can be more friendly to each other.

However, I'm a bit curious about when you say

> Suggesting that someone pours over documentation (and laughably source code) to explain patterns (or a lack thereof) in a highly abstracted language is counter-productive.

Isn't that what documentation is for? To learn about whatever's being documented. What would you suggest would be the better way to convey this information?

For source code, I can see your point. Although in my experience source code has the benefit that you can be certain that it doesn't lie. It does exactly what it says. Sometimes this can be a really nice benefit when trying to figure out what's going on. Regardless of the language or environment you are in.

Re:Thoughts on Elixir, Phoenix and LiveView after 18 months ... by Supermancho on Monday August 14, 2023 @03:28PM (#37125676)
> Isn't that what documentation is for?

I would agree, if everything was documented. The issue at-hand is what is not explicitly documented. What constitutes a guard-worthy function? ie A pure javadoc without any notation about what the API does, is not sufficient.

Re:Thoughts on Elixir, Phoenix and LiveView after 18 months ... by josevalim on Monday August 14, 2023 @07:55PM (#37128369)
> The issue at-hand is what is not explicitly documented. What constitutes a guard-worthy function?

https://hexdocs.pm/elixir/1.15/patterns-and-guards.html#guar...

Plus the docs lists on the sidebar which custom functions are guards. Examples: https://hexdocs.pm/elixir/1.15/Integer.html#guards

Re:Thoughts on Elixir, Phoenix and LiveView after 18 months ... by Supermancho on Friday August 18, 2023 @06:42AM (#37173805)
The question was about why not what is allowed as a guard. Perhaps this was not clear amongst the noise.
Re:Thoughts on Elixir, Phoenix and LiveView after 18 months ... by josevalim on Sunday August 20, 2023 @06:26AM (#37197801)
Second paragraph of the first link:

> Not all expressions are allowed in guard clauses, but only a handful of them. This is a deliberate choice. This way, Elixir (and Erlang) can make sure that nothing bad happens while executing guards and no mutations happen anywhere. It also allows the compiler to optimize the code related to guards efficiently.

If it can be improved, please let me know.