Weeknotes 17
24th October, 2021
“Safe MacBook Navigation”
-
The StandardRB check seems to be broken again. FML.
-
I read Ruby Safe Navigation from ThoughtBot this week. The article makes a lot of good points. When I first head that this new operator was being added to Ruby I wondered whether this sort of usage might result. I myself have seen it being liberally sprinkled around codebases. It should be used with care, which unfortunately doesn’t seem to happen.
-
Another read this week: Organizing business logic in Rails with contexts. I’ve admired the Phoenix way of doing things too, but not having much practical experience with Elixir/Phoenix means I’m not really qualified to say whether it works in practice, but I’ve heard it does.
In particular I like the idea of returning an explicit
Result
object. It’s idiomatic in Elixir to return a tuple like{:ok, thing}
when successful and{:error, reason}
when it’s not. And in Rust there are many types of “Result"s that can be returned and must be handled. In Ruby I only ever see anil
or a boolean, which is a shame. -
Apple released their new MacBook Pro line this week. Thank, god. It doesn’t seem like they fucked it. They’ve righted wrongs, and improved on what were already game changing processors. There’s a cool thread on Twitter that talks about the history of how Apple got to the current ARM future.