My OTP 21 Highlights
OTP 21 is out! 🎉 In this post I’m going to list things that, I think, will matter the most for Elixir users.
»OTP 21 is out! 🎉 In this post I’m going to list things that, I think, will matter the most for Elixir users.
»Some time ago I wrote an article on error handling in Elixir libraries. Today, I’d like to follow up with a piece on an equally important issue - proper handling of configuration.
»The recent changes around Phoenix 1.3, especially the introduction of contexts, seem to be confusing for many - I decided to write a bit more about my perspective on this, and hopefully, remove a bit of the confusion.
»Last weekend I attended the wroc_love.rb conference in the beautiful city of Wrocław. I got a chance to be a member of the “Ruby vs Elixir” panel session and spent hours discussing related topics during the afterparties.
»There was an interesting discussion yesterday on the Elixir Slack about how libraries should handle errors. This is a more thought-through and elaborate expression on my views on the matter. In the post, I’ll present an idealised version of how I think a public API for functions that may produce errors should look like.
»The Unix Timestamps in Elixir post is by far my most popular one. Because a lot changed in recent Elixir versions when it comes to handling of calendar types (such as dates, datetimes and times), I though it might be a good idea to update it.
»Recently, at university, we had a class that introduced the idea of logic programming and explored a bit the Prolog language. I decided to play a bit more with it and write a Sudoku solver. Let’s see how it turned out.
»When building JSON APIs you often find yourself in a situation when you have part of the JSON already encoded and want to embed it in a bigger structure. A common solution is to decode the encoded part and embed the outer structure just to encode it back again. It’s obvious how that back-and-forth decoding and encoding is wasteful. Fortunately with poison we have a much better alternative.
»When Edsger Dijkstra wrote his famous letter “Go-to statement considered
harmful” in 1968 the programming world was split between goto-supporters and
goto-opponents. The first claimed goto simplifies programs and makes them faster,
the others argued it makes programs hard to follow and understand.
Today we live in a world where the goto-opponents clearly won. Almost all modern
programming languages are devoid of goto, and those that have it, use it
sparingly.
Yet today, according to many, we face another monster - if
. Some argue is
as harmful as goto and should be avoided at all cost.
Lists are a basic data structure in functional languages, but they are also
quite confusing for people accustomed to dealing with mutable arrays in
imperative languages. The two things: arrays and lists are used in similar
situations, they are however more different than it may seem. I’d like to
address that explaining how lists work and implementing couple of functions form
Enum
module ourselves.
Lately, I started learning Haskell, and I’m really enjoying the insight this provides. I’ll probably expand on that another time. Today I’d like to share with you the first bigger program I wrote in Haskell.
»Inspired by last Erlang Thursday by Steven Proctor - Functional fizzbuzz I decided to give it a try and see how a FizzBuzz implementation without a modulus operator might look like in Elixir.
»I was working on a project where I needed to download Gravatars of all contributors to a given git repository. But, there can be a lot of them, so doing this in parallel may be a good idea. Oh, I know a language that is good at concurrency! Let’s use Elixir for this.
»Lately, there were several people asking on IRC how to deal with unix timestamps in Elixir, so I decided to write a little bit more about this.
»As I wrote last week, this summer I’m working on bringing the power of NoSQL to Ecto. This week I’d like to share with you what I learned about Ecto adapters alongside some tips on how to implement Ecto adapters for new databases.
»It’s already over a month I’ve been working on my Google Summer of Code project - providing Ecto with NoSQL adapters. Before my work began we decided together with José Valim - my mentor and creator of the Elixir programming language - to start with MongoDB. There were couple of reasons, among them the fact that it’s one of the most popular NoSQL databases, and it seemed that even though it’s not a SQL database the semantics are not that distant.
»