HackerTube

Ruby Conf 12 - Boundaries by Gary Bernhardt

ConfreaksRecommended by 8 HN commenters across 9 months, 2015–2024
YouTube
talk · intermediate · evergreen · 2015–2024 on HN

Gary Bernhardt's RubyConf 2012 talk on testing in isolation without mocking everything. It goes through behavior versus data, mutation versus immutability, and how a functional core with an imperative shell yields natural isolation and parallelism.

HN recommends it as the canonical presentation of 'functional core, imperative shell' and a practical answer to unit versus integration testing.

12 comments from Hacker News

@AaronFriel2020-10 · in “A Theory of Software Architecture”

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": ▶ this video

Strongly recommends View on HN
@dnautics2020-03 · in “I Don't Use Classes”

> I find some problems are solved better in an OO way such as interacting with a relational database. I've switched to functional interactions with a database, (Elixir/Ecto) and really, it's much better. In particular the explicit and declarative nature of the database interactions combines the convenience of an ORM with "not hiding important gotchas from you". I'm not arguing for pure functional systems (which I can see going very poorly with relational databases). There are some things that objects are good at like caching state as a model. But even here the FP systems typically do it better via FP actors and (again, impure) message passing, which enforces no-shared memory, and at least in erlang virtual machine systems, couples segregated state with limiting blast radius for your systems failure domains, which is 150% the "right thing to do". Of course if we're getting pedantic, this is even close to OO the way that Alan Kay imagined it, than what the OP and GP talk about, and I don't consider that to be OO in the contemporary, colloquial sense of "everything that happened after Bjarne Soustroup invented C++" I highly recommend this video for a more philosophical take on how to do "impure FP" without OO that is informed by a decade of industry experience: ▶ this video which is by Gary Bernhardt (of WAT fame) > I look for the right tool for the job rather than some idealistic purity This is all about right tool for the job. IMO, FP code is easier to read, easier to reason about,

Strongly recommends View on HN
@dnautics2020-01 · in “Elixir v1.10”

if you are a rubyist, I can't more strongly recommend watching this video, which has nothing to do directly with Elixir (in fact it precedes elixir by a couple of years) but if the topics that Bernhart (of wat fame) brings up resonate with you, then you will really like Elixir. ▶ this video

Strongly recommends View on HN
@pmarreck2016-04 · in “Have Software Developers Given Up?”

Here is the infamous Nagappan TDD paper from Microsoft Research link Also discussed in this infoq article link Here's someone's thesis paper on it, with data: link There's also interesting discussions like this link "it is my experience that the value proposition for TDD grows exponentially as the time and resources involved in a project grows linearly." This has also been my own experience. This person's comment also is interesting and has data link Some of the above is empirical (read: scientific, no-bullshit) data. My opinion on it has grown to the point that I think TDD should literally be inseparable from programming, and the two together should simply be called, "programming." Lacking any unit tests whatsoever (TDD or otherwise) should be called, "taking stupid, extremely hazardous risks to save a little time, like reading your phone while driving" I've not found a programming task in at least 5 years that wasn't waaaay better-written when done via TDD. Some things, like IO, can be a challenge to unit-test, but that's why we have great ideas to solve that like Gary Bernhardt's awesome "Boundaries" talk ▶ this video

Strongly recommends View on HN
@dnautics2021-06 · in “Onboarding to Elixir”

> Jose has really thread a needle with Elixir I feel. There was kind of something in the zeitgeist ready for this... This was a video by Gary Bernhardt in 2012 (that's like, Elixir -2 years?). I've queued it up to where he talks about basically wanting to go live on a cruise ship, fork rubinius, and rebuild ruby on top of erlang. The main chunk of the talk is about the software pattern that Phoenix and Elixir really tries to get you to adopt. ▶ this video

Recommends View on HN