In today’s free Monday episode of RubyTapas, some thoughts on how to enable method logic to remain stable and unchanged while evolving and changing the source and scope of the values used by the logic.
Avdi Grimm, Code Cleric
In today’s free Monday episode of RubyTapas, some thoughts on how to enable method logic to remain stable and unchanged while evolving and changing the source and scope of the values used by the logic.
Well done, very informative and got me thinking. I would be interested to see how you would see this playing into rails views.
I have some specific techniques for that, so I’ve added this to my episode idea queue. Thanks!
Great episode, and I love the Discworld reference 🙂
🙂
This episode was really good.
Thanks!
I always thought which version is better:
def full_name; “#{@first_name} #{@last_name}”; end
def full_name; “#{first_name} #{last_name}”; end
So you’re suggesting to stick with the second variant when there’s attr_reader for both :first_name and :full_name specified?
Thank you for this episode. I was wondering, what emacs stuff do you use to do that ‘evaluate and insert as comment’ trick?
the rcodetools gem, with its included emacs extension.
Great video, and a neat pattern. Elixir has a similar mechanism — mixfiles take advantage of it (see deps):
defmodule MyApp.Mixfile do
def project do
[…,
deps: deps]
end
defp deps do
[{:ecto, “~> 0.3.0”}]
end
end
When reading more complex code, barewords for function calls does make the references harder to trace; you have to check multiple contexts to know how a reference is being resolved. I rambled about that here: http://jtmoulia.pocketknife.io/blog/2015/03/12/elixir-fun-call-parens/
Hey, Avdi! Don’t look now but your shortcode is showing 🙂 … and your video is not.
Whoops! Fixed.