Ruby for All

Ruby for All

By Andrew Mason & Julie JTechnologyEducation
Download on the App Store

Ruby for All episodes

  • Favorite Ruby Methods: Part 2 - The Hash

    On this episode of Ruby for All, Julie tells us she’s working on a new app and she’s calling it “Today,” which is going to help her organize her day-to-day tasks. We’re also continuing with our February series talking about different object types in Ruby and our favorite methods with them. Today, we’re talking about the Ruby Hashes, such as merge, fetch, dig, .new, values, transform values, reject, key?, and compact. Hash is so important for Ruby developers, because the more you know, the better you can write. Julie tells us how she couldn’t grasp the Hash object when she first was learning Ruby, and Andrew shares his journey of learning other programming languages before learning Ruby and how it helped him appreciate Ruby. After today, he’s happy to know when to use dig now! Julie and Andrew hope this episode helps you like it’s helped them! Download this episode now find out more!   


    [00:01:13] Since Julie’s been building a new app for herself to stay organized daily, she tells us about playing around with ChatGPT, and Andrew explains ChatGPT is trained better on source code and other things.


    [00:03:10] Andrew talks about GitHub’s Copilot and what it does.


    [00:03:55] Our February series is continuing with talking about different object types in Ruby and we’re starting with a Hash, which is a dictionary light collection of unique keys and their values. Also called Associative Arrays, they’re similar to Array, but where an array uses integers its index, a hash allows you to use an object type. Julie wonders if the key can be any object.


    [00:10:29] Andrew goes into Hash merge, which returns a new Hash formed by merging each of the other hashes into a copy of self, and he explains why you would merge.


    [00:12:26] Andrew uses this next one constantly, Hash fetch, and this one returns the value for a given key if found. Julie seems to like this one, and if you’re building a lot of components, you should check this out. 


    [00:15:13] Julie brings up Hash dig, which extracts the nested values. We also learn Andrew doesn’t use Dig a lot because he can never remember when he’s supposed to use it! 


    [00:16:45] The next one is Hash.new, which returns a new empty hash object. Julie and Andrew tell us more about this one. If anyone has a use case for Hash.new and passing in, please let us know. 


    [00:20:20] Hash values at is the next one, and this returns a new array containing the values for the given keys. Andrew thinks he could use this more than he does. 


    [00:22:34] Julie explains Hash transform values, which returns a new hash object, and each entry has a key from self, a value provided by the block. How can you use this?


    [00:24:28] Next one is Hash reject, which returns a new hash object whose entries are all of those from self for which the block returns false or nil. Julie asks Andrew if we’re rejecting the keys, values, or either.


    [00:26:14] We made it to the last two for today! Andrew and Julie discuss Hash key? and Hash compact. Julie likes compact because it’s nice to be able to remove anything with no values.

    Panelists:

    Andrew Mason

    Julie J.

    Sponsors:

    Honeybadger

    Avo

    Links:

    Andrew Mason Twitter

    Andrew Mason Website

    Julie J. Twitter

    Julie J. Website

    GitHub Copilot

    Hash merge

    Hash fetch

    Hash dig

    Hash new

    Hash values at

    Hash transform values

    Hash reject

    Hash key?

    Hash compact

    31 min
  • Favorite Ruby Methods: Part 1

    On this episode of Ruby for All, Andrew and Julie discuss the cold temps where they live, their preferences for warmer temps, using layers to cope with the changing temperatures, and their experiences with snow sports.  For the month of February, get ready because Andrew and Julie are doing something fun! They’ll be going through some of their favorite Ruby methods all month on every episode, focusing on a different type of object type.  Today’s methods they discuss are map, flatten, uniq, shuffle, sample, count, any, and all. And, if that’s not enough, they also talk about Spaceship Operator and enumerator. If they missed your favorite array or they didn’t explain something well, let them know on Twitter. Download this episode now! 


    [00:05:11] Andrew and Julie want to make February fun, so they tell us what they’re doing and how Julie came across this idea. 


    [00:06:32] Let’s start with Andrew’s favorite method, the array object, which is map.


    [00:08:46] Array flatten is another one Andrew likes and he explains what it does, as well as flat map. Does flatten work on nested arrays?


    [00:11:20] Julie tells us flatten passing in zero just returns the same way and explains what she noticed when using methods, and Andrew had no idea that you could pass level to flatten until now. 


    [00:12:15] The next method is uniq, which returns a new array, but only the ones that are not duplicated. Julie wonders if you can pass in a parameter or a block with this.


    [00:15:54] Andrew doesn’t use this next method a lot which is shuffle, and this returns a new array with the elements of self-shuffled, self being the array this is called on. Did you know you can pass random to it? 


    [00:16:40] Julie brings up the next method which is sample on an array. Sample returns a random element from the array, and we hear she used shuffle and sample in practice.


    [00:18:20] The last method is count, which returns the count of specified elements, and if you don’t pass it a block or an argument, it will return the count of all elements. 


    [00:20:55] When would you want to use a SQL count query versus not? Andrew talks about a great article you can check out on ActiveRecord, and to clarify, dot length is something you would NOT want to use with ActiveRecord, use size. 


    [00:22:02] Julie tells us she will use size and not worry if it’s loaded or not and Andrew reads something from an article Nate Berkopec wrote. 


    [00:22:46] The next method is min/max which returns a two-element array containing the minimum and the maximum value, and Andrew does his best to explain what Spaceship Operator and enumerator are.


    [00:28:17] Julie touches on some other methods, these aliases for example, maps alias is collect, and filter select, inject, reject, detect, and inspect.  There is one more array that Julie brings up which is any, all, none where you can pass the any method and a block, and it will return true if any one of the elements met that criteria.



    Panelists:

    Andrew Mason

    Julie J.



    Sponsors:

    Honeybadger

    GoRails



    Links:

    Andrew Mason Twitter

    Andrew Mason Website

    Julie J. Twitter

    Julie J. Website

    3 ActiveRecord Mistakes That Slow Down Rails Apps: Count, Where and Present-by Nate Berkopec of speedshop
    Ruby’s Spaceship Operator-Tech Talent South


    32 min
  • Common Pitfalls for Junior Ruby on Rails Developers

    [00:01:29] Julie and Andrew tell us what the hardest part of learning Rails was for them. 


    [00:02:03] Andrew explains what to test and not to test, provides examples, and mentions the Shoulda gem.


    [00:04:48] Julie wonders if there’s a way create data in your tests without adding to the database and Andrew explains using Factory Bot’s build_stubbed.


    [00:07:54] Fabricate gem is brought up since Julie uses that and she wonders how to name the variables for the stubs and mocks.


    [00:11:11] Have you ever modified data in production, and do you know about Sandbox command? Julie has used it and Andrew tells us why you should use it. 


    [00:13:32] Julie wonders if there’s anything she needs to be concerned or careful with using that Sandbox flag. 


    [00:14:40] Andrew “the cowboy coder” shares what he did with modified data in production. 


    [00:16:21] Impersonation is explained as Andrew shares his tip to have a different colored nav bar, Julie explains how she added colors on each Chrome bar for her kid’s accounts, and there’s a new color thing in Safari where it modifies the appearance. 


    [00:18:17] The topic of using a ton of instance variables and not using enough objects is discussed, and if you’re using current users instance variables, check out CurrentAttributes.


    [00:21:39] What is a Decorator and how do you wrap a post in it? Andrew talks about a Decorator gem called Draper, explains what a service object does, and where he puts it in his directory. 


    [00:27:19] We hear some other examples of a Service Object, and one is using it to create a Zoom session. 


    [00:28:21] Julie wonders what happens if you’re working with someone who is strongly passionate against what you are strongly passionate about, and code keeps getting moved around or shifted because of that. 

    Panelists:

    Andrew Mason

    Julie J.

    Sponsors:

    Honeybadger

    Avo

    Links:

    Andrew Mason Twitter

    Andrew Mason Website

    Julie J. Twitter

    Julie J. Website
    ChatGPT

    Shoulda

    Use Factory Bot’s build_stubbed for a Faster Test Suite-thoughtbot

    How to use Fabricate-gem to generate objects? -Stack Overflow

    User Impersonate

    Safari Menu Bar Theme Color Match

    ActiveSupport::CurrentAttributes

    Draper: View Models for Rails

    31 min
  • The Database Wizard with Andrew Atkinson

    Timestamps

    [01:19] Andy tells us a bit about himself, and how his journey led him to becoming a database specialist.

    [03:17] How do you pronounce SQL? Andy explains why he pronounces it the way he does and what SQL actually stands for.

    [04:38] Have you ever wondered if PostgreSQL is faster than MySQL? What goes into measuring database performance?

    [10:19] Andrew asks Andy to dive deeper into transactions and locking in Rails which leads into a longer discussion around what locks are.

    [17:08] Julie asks Andy why he prefers PostgreSQL over MySQL and how he arrived at that position.

    [20:46] Andrew asks Andy what pgbouncer is and why you may want to add it to your application and when.

    [22:51] Julie asks Andy a database archictecture question about when you should use join tables instead of Array or JSON columns.

    [27:18] As the show winds down, Andrew asks Andy to come back on the show soon so they can keep discussing this topic.

     

    Sponsor

    GoRails

    Honeybadger


    Links

    - Andy on Twitter

    - Andy's Website

    - MariaDB

    - PostgreSQL

    - MySql

    - Rails Pessimistic Locking

    - Rails Optimistic Locking

    - Heroku

    - Capistrano

    - Fly.io

    - Kubernetes

    - Amazon RDS

    - pgbouncer



    29 min
  • Integrations with Brittany Martin

    Timestamps

    [00:45] Brittany Martin, co-host of the Ruby on Rails Podcast and engineering manager, joins the show and introduces herself to folks that may not know her yet.

    [02:00] Brittany asks Julie what her experience with integrations has been so far in her career and explains what integrations in software are.

    [08:15] Brittany explains what webhooks are and ties it to Julie's integration example and why they are beneficial for your customers.

    [11:40] Julie asks Brittany about websockets.

    [16:30] Julie and Brittany discuss a presentation she recently gave and how Brittany feels about slide decks. 

    [18:40] Brittany talks about retrying webhooks and why they are important for your customers.

    [20:00] Julie asks about how Brittany deals with questions that may come in after presentations and they also talk about wikis.

    [22:40] Brittany talks about how she gets started with creating integrations and what you should look for from existing gem integrations. Do you like writing gems or Rails code better?

    [26:45] Brittany explains why it's beneficial for juniors to learn more about integrations early in their career.


    Sponsor

    Honeybadger


    Links

    - Brittany on Twitter

    - The Ruby on Rails Podcast

    - CircleCI

    - googlepay gem

    29 min
  • What's Going on in 2023?

    Timestamps

    [00:30] Do you set New Years resolutions? Andrew and Julie talk about whether they set them for themselves and the problems they have had with them in the past.

    [03:27] Julie asks Andrew if he is a proactive or reactive person and how she wants to be more proactive in 2023 and the pair talk about deadlines.

    [07:00] Julie and Andrew share their goals for 2023. What are your goals?

    [13:10] Andrew is learning Swift and Vim and Julie is trying to increase her React skills.

    [19:30] Julie shares a sneak peak at some upcoming episodes you can look forward to in 2023.


    Sponsor

    GoRails


    Links

    - Ruby 3.2.0 Released

    - The Well Grounded Rubyist

    - Swift Playgrounds

    23 min
  • Work Processes

    Timestamps

    [2:04] Julie begins to explain her work process to Andrew before the pair tear off into a tangent on Agile vs Watefall methodology

    [07:15] Julie talks about she points stories and Andrew reveals he doesn't use a point system currently, but has in the past. What are your thoughts on changing story points?

    [13:02] Retros anyone? Andrew and Julie talk about project meetings and how to make sure everyone is able to contribute and the tools they use for them.

    [16:39] Andrew talks about the way he is currently working at Podia and how it's a bit different from how he's worked in the past.

    [19:30] Do product managers need to be technical? Who should assign points to projects?

    [23:30] Standups! Andrew doesn't have a lot of meetings and Julie details the types of meetings she usually has. Andrew also reveals why he wakes up at 4:30am each morning.

    [26:49] Andrew knows this wasn't the greatest explanations of Agile and opens the door to any guests interested in coming on the show to do a deep dive on Agile.


    Sponsor

    GoRails


    Links

    What is Agile?

    Waterfall Methodology

    FigJam

    parabol

    Podia's product process by Spencery Fry

    Art of Product Podcast #161: The Podia Operating System

    28 min
  • Reading Source Code with Daniel Colson

    Timestamps

    [00:45] Daniel Colson is our guest today and gives a brief introduction. He is also a FactoryBot maintainer and explains what it is.

    [02:40] Andrew is curious about the relation to Music majors and programming and Daniel has some ideas on it.

    [03:20] How much of your time is spent reading code? Daniel talks about the different types of code programmers often have to read and the benefits that come along with it. Andrew explains why he reads a lot of source code and how it made him better at code review.

    [06:30] Do you copy and paste code without always understanding it fully? You aren't alone! Daniel has some suggestions for trusting your curiosity and how he likes to read gem source code and how the tests can provide lots of clues. 

    [13:38] Daniel has been reading the Ruby source code and dives into the why and his journey into learning C.

    [20:20] How do we test the performance of code? Daniel suggests using benchmark-ips for Ruby code and why evaluating performance is important. 

    [23:10] Julie asks if Ruby Under a Microscope would be a good book for juniors to read. 

    [25:40] Daniel believes in a concept called "flipped classroom", which he explains and how it applies to learning programming. He also explains how he would prefer to give more interactive conference talks, which Julie and Andrew both encourage.

    [29:20] Daniel has a new library for profiling FactoryBot that you will definitely want to check out!


    Sponsor

    Special thanks to Andy Croll for personally sponsoring this episode. Be sure to check out firstrubyfriend.org and onerubything.com for nice, free community resources for newer devs!

    Links
    Daniel on GitHub
    Ruby Under a Microscope

    benchmark-ips

    TestProf

    factory_bot_profile

    32 min
  • The Holidays - Unleash Your Empathy and Spread Good Cheer

    Timestamps

    [00:38] Julie and Andrew talk about exercising, home workouts, and video games

    [06:15] The holidays are approaching and we are a little SAD. Can your GitHub commit graph be used to notice changes in mood?

    [07:40] Andrew brings up the how the weather affects his mood.

    [08:55] Julie finds it harder to focus when it's rainy and cold

    [09:45] Find out what "Tech the Halls" is and why Andrew is really excited for December and what he will be doing at Podia this month

    [11:15] Julie participated in a hackathon recently and really enjoyed it

    [12:00] Do you control what you focus on at work? Andrew really likes companies that give their developers time to work on personal itches, open source, and increase their learning.

    [13:30] Curious what Andrew is building for "Tech the Halls"? He describes the problem and solution to Julie.

    [18:20] Julie asks about serverless functions and Andrew claims he doesn't want to talk about them before proceeding to try and explain what they are from a high level.

    [20:50] We are back to talking about the holidays and how to make it more fun for your team. Small gestures can go a small way!

    [23:45] It's a stressful time of year so empathy and grace are the messages that Andrew and Julie want you to spread.

    [28:45] Julie asks one last question before they sign off about discussing allocating time for these types of projects with your manager


    Sponsor

    GoRails


    Links

    Heroku Docs: App Webhooks

    AWS Lambda

    Serverless Functions on Vercel

    [YouTube] Kids Crash Live TV Interview



    32 min
  • GitHub Codespaces & Julie's RubyConf Mini Recap

    Timestamps

    [00:45] Andrew recaps pairing with Collin and some other folks over the weekend on an open source PR

    [2:40] Andrew launches a discussion around GitHub Codespace configs for open source projects and how that would have made his life easier. Julie also brings up Tuple as another great tool for pairing

    [5:15] Julie brings up trying to use Codespaces to pair on Rails, which does have a configuration file 

    [6:00] Andrew gives a basic explanation of what Codespaces, why it's helpful, and some of the struggles he's had with it\

    [10:45] Julie gives Andrew a recap of RubyConf Mini

    [11:40] Andrew and Julie talk about feeling down after conferences

    [14:00] Julie talks about why flying is stressful for her and how she got a lucky break on her flight home from the conference

    [17:00] Julie talks about the speaker dinner prior to the conference and some of the other events she attended

    [18:30] Julie talks about giving her talk. And don't worry! She had a nodder!

    [20:00] Julie talks about being on the conference panel that you all heard last week

    [22:00] Andrew wants to hear about the food and Julie delivers!

    [23:30] Julie gives her final thoughts on the conference and Andrew advocates for doing more local conferences


    Sponsor

    Special thanks to Andy Croll for personally sponsoring this episode. Be sure to check out firstrubyfriend.org and onerubything.com for nice, free community resources for newer devs!

    Links
    Tuple
    GitHub Codespaces
    Using Codespaces with VS Code

    26 min

About Ruby for All

From the publisher's feed

A weekly Ruby focused podcast hosted by Andrew Mason and Julie J. Each week we discuss topics ranging from Ruby, Ruby on Rails, learning, how to be a better developer, and more. The focus is on…