Waseem
waseem-medhat.bsky.social
Waseem
@waseem-medhat.bsky.social
Programmer // Elixir Fanboy // Possibly DevOps? // Music Nerd (I suck at playing the bass)

https://overthinking-development.blog
https://github.com/waseem-medhat
It's a tough balance but yeah at some point you gotta maintain "blissful ignorance" with some things, or so I believe
December 23, 2024 at 11:50 PM
IMHO I think adding a name often helps with making the code more self-documenting, especially when there are multiple occurrences of that variable in other clauses.
December 11, 2024 at 10:07 PM
Simple one but I didn't know it existed before: `List.duplicate/2`

hexdocs.pm/elixir/List....
December 11, 2024 at 11:21 AM
I always used `length/1` for lists but then discovered `Enum.count/1` which works for enumerables in general.

hexdocs.pm/elixir/Enum....
December 10, 2024 at 8:47 PM
Nice 🐫
I'm this close to giving up ngl
December 9, 2024 at 11:08 AM
I also learned some basic usage of ETS as an in-memory cache.

hexdocs.pm/elixir/erlan...
December 8, 2024 at 7:40 PM
`NimbleParsec` is a library that provides a declarative and concise way for parsing data out of text.

hexdocs.pm/nimble_parse...
December 8, 2024 at 7:40 PM
`Enum.reduce_while/3` is an alternative way of doing "early returns" where I was used to do only recursion + multiple clauses for that.

hexdocs.pm/elixir/Enum....
December 8, 2024 at 7:40 PM
`Enum.chunk_every/4` is very nice for sliding window algorithms.

hexdocs.pm/elixir/Enum....
December 8, 2024 at 7:40 PM
`Map.merge/3`: I already knew `Map.merge/2` but the 3-arity variant takes an extra function that specifies how to merge two values if duplicate keys exist.

hexdocs.pm/elixir/Map.h...
December 8, 2024 at 7:40 PM
December 8, 2024 at 5:37 PM