HNHacker News
TopNewBestAskShowJobs

dc0d

9 karma · joined March 27, 2013

submissionscomments
dc0d··on ElixirNitpicks
Thank you for the reference (not finished it yet).

Worth mentioning functions that can error, should follow the {:ok, response} | {:error, reason} pattern. Because if such a function returns response | {:error, reason}, then if we are inside a with clause and we want to capture the response and use it in the next with clause, such capture value can be either response or {:error, reason} - which goes around the pattern matching.

  with response_f1 <- f1(),
       {:ok, response_f2} <- f2(response_f1) do
    # do something
  else
    {:error, reason_f1} ->
      # we will never come here
      # because the returned value from f1
      # is already matched to the variable response_f1 
  end
dc0d··on ElixirNitpicks
> There’s a cultural split between Erlang and Elixir that makes life harder than it needs to be.

On that note I have witnessed: "Finding Erlang developers was hard. And I hated Elixir. So, we ported everything to Java."

Maybe that was just one such occasion. Maybe there are more.

dc0d··on Ten years without Elixir
"There are only two kinds of languages: the ones people complain about and the ones nobody uses."

― Bjarne Stroustrup, creator of C++ programming language

The fact that Elixir is getting some hate is a good sign - it's reach is growing.

dc0d··on Goreuse: Generic Code for Go
Mostly. But since it is possible to replace/redefine the functions and methods too, it's a bit more capable than that and one can "override" methods or redefine functions.
dc0d··on Goreuse: Generic Code for Go
goreuse takes Go, modifies the AST by replacing those parts that are needed to be customized and generates a Go source that is specialized for concrete types. It is "go generate" compatible.
dc0d··on ETag Middleware (for Golang)
I have to do web projects from time to time and every time, I reinvented this wheel. Finally got the time to put it together. Might come in handy for somebody else too.