HN Theater @HNTheaterMonth

The best talks and videos of Hacker News.

Hacker News Comments on
Writing Beautiful Code - Garrett Smith

Erlang Solutions · Youtube · 7 HN points · 2 HN comments
HN Theater has aggregated all Hacker News stories and comments that mention Erlang Solutions's video "Writing Beautiful Code - Garrett Smith".
Youtube Summary
Erlang Factory SF Bay Area 2013
More info and slides on the website: http://www.erlang-factory.com/conference/SFBay2013/talks

One of the most common questions on Stack Exchange is "Why does Erlang syntax resemble Prolog with asphyxia?" [1]

In this talk, Garrett will obliterate the notion that Erlang syntax is weird or that you can't use it to write beautiful code. The plain truth is that it's easier to write beautiful code in Erlang than it is in most other languages.

Garrett will describe methods for writing luscious, gorgeous, easy to read and maintain Erlang programs. He will cover topics such as:

- API design
- Function and variable names
- Proper use of case and if expressions
- Managing complex data structures
- Code refactoring
- Common functional patterns

Garrett will draw from the coding styles of the Erlang masters as well as his own experience an Erlang programmer and instructor. He will argue will a zeal bordering on religious fervor, chiding those with different views. [2]

[1] In fact, not a common question on Stack Exchange

[2] No one will be chided -- the presentation will be quite congenial
HN Theater Rankings

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.

https://www.youtube.com/watch?v=IdJwECjylB4

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.

sametmax
I 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.

ams6110
It'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.
Jul 30, 2015 · 3 points, 0 comments · submitted by ShaneWilton
Jul 30, 2015 · 4 points, 0 comments · submitted by ShaneWilton
HN Theater is an independent project and is not operated by Y Combinator or any of the video hosting platforms linked to on this site.
~ yaj@
;laksdfhjdhksalkfj more things
yahnd.com ~ Privacy Policy ~
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.