4 ms·
A few years ago I was on a team and the dev lead had a practice of sharing Gary Bernhardt's Boundaries talk every time there was some degree of rotation or chur
by AaronFriel 6y ago
A few years ago I was on a team and the dev lead had a practice of sharing Gary Bernhardt's Boundaries talk every time there was some degree of rotation or churn on the team. Almost part of the onboarding. As a functional programming aficionado, I didn't need the sales pitch, but it was the presentation that was gripping.
Keep in mind, Ruby isn't a functional language, but here was this presenter describing essentially how you write good Haskell code, but in Ruby! A language that makes it so easy to mutate in place that it's known for libraries that "monkey patch" base classes and can change the definition of operators and functions at runtime!
Fantastic talk, fantastic presentation. I now share it with my new engineering colleagues too.
Here's the talk where he talks about imperative shell, functional core, "Boundaries": https://www.youtube.com/watch?v=yTkzNHF6rMs https://www.youtube.com/watch?v=yTkzNHF6rMs
- Huggernaut 6y agoI think Gary shared a Twitter related project that was written in this way, but do you have any examples of other projects by any chance?
- dnautics 6y ago"most projects in elixir". Some good open-source examples are oban, hex.pm, papercups.io
- AaronFriel 6y agoAh, I am blocked by Gary on Twitter and there is some irony that his Boundaries talk culminates in a Twitter client. (Gary if you're reading this I enjoyed your feed!) I'm not aware of any good OSS examples, either. I think React and Redux are in a way an implementation of these concepts. React is a view layer that sends messages and each component is (ideally) a pure function of state, and sometimes its own history. It's so, so easy to unit test the interactions. Hooks make it a little harder to reason about, and it's unfortunately easy to write hooks that perform IO and you suddenly end up in a miasma of difficult-to-test code where you have to return to using a mocking library to "replace" IO functions with fake versions, and then you're on a slippery slope again toward mixing interaction and mutation in one layer.
- dnautics 6y agoThe talk is fantastic. The interesting thing about that talk is that he advocates using a functional style in ruby and quietly suggests that in the end the coder should 'probably use erlang'. It turned out that jose valim was working on elixir at that time, which basically became exactly what gary was asking for (a rubyish erlang). It's a shame that gary doesn't use elixir.
- barrkel 6y agoWhat is a functional language - something that encourages programming in a functional style, or actively outlaws imperative programming? IMO it's pleasant to use Ruby in a functional style, much more pleasant than Python owing to the ease of chaining calls that take lambda arguments (blocks). Every time I try to do something similar to a big chained Enumerator stream in Ruby in Python using a list comprehension, I have to invert my thinking - as far as I'm concerned, those things are written backwards and inside out.