Hacker News Comments on
Writing Beautiful Code - Garrett Smith
Erlang Solutions
·
Youtube
·
7
HN points
·
2
HN comments
- This course is unranked · view top recommended courses
Hacker News Stories and Comments
All the comments and stories posted to Hacker News that reference this video.I'm glad you enjoyed it! Some of these patterns are a little controversial, because they add extra layers of indirection + bloat the code, but I've personally always found that they make Erlang / Elixir much more readable.One of my favourite talks is "Writing Beautiful Code" by Garrett Smith (of "MongoDB is Web Scale" fame), and he walks through refactoring a part of CouchDB (also in Erlang) by using some of these techniques.
I've had about the same experience getting started with Erlang. It was mostly using recursive, immutable state and the functional style that was hard to get my head wrapped around.Pattern matching was somewhat hard but you can of course program by not using them, then during code reviews, you start getting advice like "split into a separate function clause". So bit by bit I started to get patter of using patterns and guards.
A thing that helped there was watching Garrett Smith's "Beautiful Erlang" video:
https://www.youtube.com/watch?v=IdJwECjylB4
On concurrency I had already did enough programming with threads before that and didn't have much difficulty understanding processes, pids and messages. Well except for being happy to get isolated heaps, smaller size threads (a few KBs) and supervision trees.
⬐ sametmaxI find that the harder with immutability is to go for it with a blank head. After that it's ok.Indeed if i use my xp from other languages, my brain screams that it's ineficient and will kill perfs. Old habits die hard.
⬐ ams6110It's funny how people understand different things in different ways. For me, 00 style programming was what I could never get my head fully around. Erlang immediately made sense to me. It's my favorite language and I wish I could use it more on the job.