New blog/newsletter:

Better Know A Ruby Thing 4: Keyword Arguments

noelrappin.com/blog/2024/02/be

I thought this one was going to be shorter than the positional arguments. It's not. Buttondown gently asked me if I wanted more interstitial subscribe reminders. (I don’t).

Anyway, everything you wanted to know about keyword arguments in and probably a couple of things you didn't know you wanted to know.

Subscribers should see this in their inboxes shortly.

2
Share
Share on Mastodon
Share on Twitter
Share on Facebook
Share on Linkedin
James Blanding

@noelrap > My main hot take about keyword arguments is the same as my take about positional arguments – there’s every chance that your code would be clearer if you used more positional arguments.

Did you mean to say "...more keyword arguments" there? It seems like your Hot Take in your previous post was that you prefer keyword arguments over positional in a method that takes 3 or more, so I'm having trouble reconciling that with the sentence above. Quite possibly a me problem though... 😅

2
9mo
Noel Rappin

Somewhat embarrassing error in the final paragraph, it should say “there’s every chance that your code would be clearer if you used more keyword arguments. “ -- I probably won't send out an updated email or a correction email, but I did update it on the blog. #ruby

1
9mo
Replies