<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Kate (she/her)</title>
    <description>The latest articles on Forem by Kate (she/her) (@kateh).</description>
    <link>https://forem.com/kateh</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F463793%2Fe6d11fad-5abb-4569-8534-2ff2287a4c33.jpg</url>
      <title>Forem: Kate (she/her)</title>
      <link>https://forem.com/kateh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kateh"/>
    <language>en</language>
    <item>
      <title>Understanding blank?, present?, empty?, any?, and nil? in Ruby (and Rails)</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Mon, 28 Dec 2020 16:16:44 +0000</pubDate>
      <link>https://forem.com/kateh/understanding-blank-present-empty-any-and-nil-in-ruby-and-rails-34b4</link>
      <guid>https://forem.com/kateh/understanding-blank-present-empty-any-and-nil-in-ruby-and-rails-34b4</guid>
      <description>&lt;p&gt;In Ruby on Rails, there are several methods available for checking the state of an object.&lt;/p&gt;

&lt;p&gt;The most common ones include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;blank?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;present?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;empty?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;any?&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;nil?&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It can be pretty confusing to know which method to use and when. For instance, &lt;code&gt;blank?&lt;/code&gt; and &lt;code&gt;empty?&lt;/code&gt; sound like they would behave the same way. However, they are NOT the same.&lt;/p&gt;

&lt;p&gt;Take the following example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;NoMethodError&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As you can see, these two methods respond differently to &lt;code&gt;nil&lt;/code&gt; and are not interchangeable.&lt;br&gt;
It's helpful to understand the nuances of these different state-checking methods so you aren't caught off guard by unexpected behavior.&lt;/p&gt;

&lt;p&gt;Let's dive in.&lt;/p&gt;
&lt;h2&gt;
  
  
  1. &lt;code&gt;blank?&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;blank?&lt;/code&gt; is a Rails method defined at the &lt;code&gt;Object&lt;/code&gt; class level meaning you can call it on &lt;strong&gt;any object&lt;/strong&gt;. An object is blank if it’s &lt;strong&gt;false, empty, or a whitespace string&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://apidock.com/rails/v4.2.7/Object/blank%3F"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[].&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;{}.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. &lt;code&gt;present?&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;present?&lt;/code&gt; is another Rails method that is defined at the &lt;code&gt;Object&lt;/code&gt; class level. It behaves the opposite of &lt;code&gt;blank?&lt;/code&gt;. In other words, it returns true for objects that are &lt;strong&gt;true, not empty, and not a whitespace string.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://apidock.com/rails/Object/present%3f"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="ss"&gt;:'Dog'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'Cat'&lt;/span&gt;&lt;span class="p"&gt;}.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="s1"&gt;'poop'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="s1"&gt;'hi'&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Note 📝
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;blank?&lt;/code&gt; and &lt;code&gt;present?&lt;/code&gt; are direct opposites.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;blank?&lt;/code&gt; and &lt;code&gt;present?&lt;/code&gt; can be called on any object type including &lt;code&gt;nil&lt;/code&gt;. This &lt;strong&gt;may be too all-encompassing and undesirable&lt;/strong&gt; in some cases. For example, say you expect your data to never be &lt;code&gt;nil&lt;/code&gt;. If your data ends up as &lt;code&gt;nil&lt;/code&gt; due to some bug in your codepath, these two state-checking methods will make it harder to uncover that fact as opposed to methods like &lt;code&gt;any?&lt;/code&gt; or &lt;code&gt;empty?&lt;/code&gt; which would throw a &lt;code&gt;NoMethodError&lt;/code&gt; for &lt;code&gt;nil&lt;/code&gt;. Keep in mind that for stricter type-checking purposes, &lt;code&gt;blank?&lt;/code&gt; and &lt;code&gt;present?&lt;/code&gt; may be unsuitable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. &lt;code&gt;nil?&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;nil?&lt;/code&gt; is a Ruby method defined at the &lt;code&gt;Object&lt;/code&gt; class level so it can be called on any object similar to the first two. &lt;code&gt;nil?&lt;/code&gt; only return true for &lt;code&gt;nil&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://apidock.com/ruby/Object/nil%3F"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[].&lt;/span&gt;&lt;span class="nf"&gt;nil?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="p"&gt;{}.&lt;/span&gt;&lt;span class="nf"&gt;nil?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nil?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nil?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nil?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;nil?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. &lt;code&gt;empty?&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;empty?&lt;/code&gt; is a Ruby method defined for classes including &lt;code&gt;String&lt;/code&gt;, &lt;code&gt;Hash&lt;/code&gt;, and &lt;code&gt;Array&lt;/code&gt; and will evaluate to true if the length of the object it is called on is 0.&lt;/p&gt;

&lt;p&gt;In particular:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For strings, &lt;code&gt;empty?&lt;/code&gt; evaluates to true if the string has a length of zero. &lt;a href="https://apidock.com/ruby/String/empty%3F"&gt;docs - String&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For hashes, &lt;code&gt;empty?&lt;/code&gt; returns true if the hash contains no key-value pairs. &lt;a href="https://apidock.com/ruby/Hash/empty%3F"&gt;docs - Hash&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;For arrays, &lt;code&gt;empty?&lt;/code&gt; returns true if the array contains no elements. &lt;a href="https://apidock.com/ruby/Array/empty%3F"&gt;docs - Array&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[].&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;{}.&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="s1"&gt;' '&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;NoMethodError&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Note 📝
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;blank?&lt;/code&gt; and &lt;code&gt;empty?&lt;/code&gt; respond differently to strings containing whitespace characters.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;length&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;

&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;blank?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="s2"&gt;" "&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;blank?&lt;/code&gt; may be more suitable for rejecting data with whitespace characters.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. &lt;code&gt;any?&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://apidock.com/ruby/Enumerable/any%3F"&gt;docs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;any?&lt;/code&gt; is a Ruby method defined for the &lt;code&gt;Enumerable&lt;/code&gt; module, which encompass collection classes including &lt;code&gt;Array&lt;/code&gt; and &lt;code&gt;Hash&lt;/code&gt;. It &lt;strong&gt;returns true if at least one of the collection member is not false or nil.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kp"&gt;true&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;[].&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="p"&gt;{}.&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="s1"&gt;''&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;NoMethodError&lt;/span&gt;

&lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="no"&gt;NoMethodError&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It's worth calling out that &lt;code&gt;any?&lt;/code&gt; is NOT a direct opposite of &lt;code&gt;empty?&lt;/code&gt;, like &lt;code&gt;present?&lt;/code&gt; and &lt;code&gt;blank?&lt;/code&gt; are. It's also worth calling out that truthiness of the elements within the collection matters for &lt;code&gt;any?&lt;/code&gt;, unlike the other methods discussed here.&lt;/p&gt;

&lt;p&gt;Consider the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;
&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;empty?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kp"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kp"&gt;nil&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;present?&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Additionally,
&lt;/h3&gt;

&lt;p&gt;&lt;code&gt;any?&lt;/code&gt; can accept a block. Each element of the collection gets passed to the block, and the method will evaluate to true if the block ever returns a value that is not false or nil.&lt;/p&gt;

&lt;p&gt;Examples:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;even?&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'poop'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'soup'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'loop'&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;word&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;word&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="s1"&gt;'poop'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;true&lt;/span&gt;

&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;].&lt;/span&gt;&lt;span class="nf"&gt;any?&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;odd?&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="kp"&gt;false&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;blank?&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;present?&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;nil?&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;empty?&lt;/code&gt;&lt;/th&gt;
&lt;th&gt;&lt;code&gt;any?&lt;/code&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;Rails&lt;/td&gt;
&lt;td&gt;Rails&lt;/td&gt;
&lt;td&gt;Ruby&lt;/td&gt;
&lt;td&gt;Ruby&lt;/td&gt;
&lt;td&gt;Ruby&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://apidock.com/rails/v4.2.7/Object/blank%3F"&gt;Object&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://apidock.com/rails/Object/present%3f"&gt;Object&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;&lt;a href="https://apidock.com/ruby/Object/nil%3F"&gt;Object&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://apidock.com/ruby/String/empty%3F"&gt;String&lt;/a&gt; &lt;br&gt; &lt;a href="https://apidock.com/ruby/Hash/empty%3F"&gt;Hash&lt;/a&gt; &lt;br&gt; &lt;a href="https://apidock.com/ruby/Array/empty%3F"&gt;Array&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;&lt;a href="https://apidock.com/ruby/Enumerable/any%3F"&gt;Enumerable&lt;/a&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;{}&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nil&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;NoMethodError&lt;/td&gt;
&lt;td&gt;NoMethodError&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;false&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;NoMethodError&lt;/td&gt;
&lt;td&gt;NoMethodError&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;""&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;NoMethodError&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;"   "&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;NoMethodError&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;"poop"&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;NoMethodError&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;[false]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;true&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;td&gt;false&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;References:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/questions/885414/how-to-understand-nil-vs-empty-vs-blank-in-ruby"&gt;How to understand nil vs. empty vs. blank in Ruby&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://blog.appsignal.com/2018/09/11/differences-between-nil-empty-blank-and-present.html"&gt;Differences Between #nil?, #empty?, #blank?, and #present?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ruby</category>
      <category>rails</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Understanding attr methods in Ruby!</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Mon, 07 Dec 2020 00:15:34 +0000</pubDate>
      <link>https://forem.com/kateh/understanding-attr-methods-in-ruby-412</link>
      <guid>https://forem.com/kateh/understanding-attr-methods-in-ruby-412</guid>
      <description>&lt;p&gt;If you've worked with Ruby, you've likely encounter &lt;strong&gt;attr&lt;/strong&gt; methods such as &lt;code&gt;attr_accessor&lt;/code&gt;, &lt;code&gt;attr_reader&lt;/code&gt;, and &lt;code&gt;attr_writer&lt;/code&gt; sprinkled at the top of the class.&lt;/p&gt;

&lt;p&gt;To truly understand what each of these &lt;code&gt;attr&lt;/code&gt; methods are and how to use them, we must understand the very basics of how data is stored in a Ruby class. (If you already have the basics down, skip to here!)&lt;/p&gt;

&lt;h2&gt;
  
  
  How is data stored and access in a Ruby class?
&lt;/h2&gt;

&lt;p&gt;Let’s say we’re creating a Ruby on Rails web app for a veterinary hospital 😸🐶. We want to store information about each dog patient. To start with, we will need a &lt;code&gt;Dog&lt;/code&gt; class that stores &lt;code&gt;name&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;In Ruby, this class may look something like the following:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here, we have a &lt;code&gt;Dog&lt;/code&gt; class. This &lt;code&gt;Dog&lt;/code&gt; class has an &lt;code&gt;initialize&lt;/code&gt; method which expects a &lt;code&gt;name&lt;/code&gt; parameter. Within this &lt;code&gt;initialize&lt;/code&gt; method we instantiate an &lt;strong&gt;instance variable&lt;/strong&gt; &lt;code&gt;@name&lt;/code&gt; which stores the &lt;code&gt;name&lt;/code&gt;&lt;br&gt;
parameter that is passed in when a &lt;code&gt;Dog&lt;/code&gt; instance is created.&lt;/p&gt;
&lt;h3&gt;
  
  
  What is an instance variable?
&lt;/h3&gt;

&lt;p&gt;In Ruby, instance variables are prefixed with &lt;code&gt;@&lt;/code&gt;. You may recognize instance variables being used to pass data between the controller and the view in a Ruby on Rails app. (Under the hood, Ruby on Rails is set up so that an instance variable in a controller method is accessible in the corresponding view.)&lt;/p&gt;

&lt;p&gt;Even outside of a Rails-y context, instance variables are used to store data for a regular Ruby class.&lt;/p&gt;
&lt;h4&gt;
  
  
  An instance variable can be accessed by any method within the class.
&lt;/h4&gt;

&lt;p&gt;&lt;strong&gt;Here's an Example:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;barks&lt;/span&gt;
      &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="vi"&gt;@name&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; says WOOF"&lt;/span&gt; &lt;span class="c1"&gt;# This method has access to @name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The catch here is that instance variables are accessible by any method within a class, but are NOT accessible outside the class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;If instantiate a &lt;code&gt;Dog&lt;/code&gt; instance and try to call &lt;code&gt;.name&lt;/code&gt;, we get a &lt;code&gt;NoMethodError&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tomi'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; &amp;lt;Dog:0x00007fb72cd0aa30 @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; NoMethodError: undefined method `name` for #&amp;lt;Dog:0x00007fb72eab6bb0 @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If we want to read the &lt;code&gt;@name&lt;/code&gt; value stored on a &lt;code&gt;Dog&lt;/code&gt; instance, we'll need to access it through a method.&lt;/p&gt;

&lt;p&gt;Let's define a simple method that returns &lt;code&gt;@name&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="c1"&gt;# Method that returns @name&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we are able to access the value of &lt;code&gt;@name&lt;/code&gt; by calling the name method!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tomi'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; "Tomi"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This simple &lt;code&gt;name&lt;/code&gt; method we just defined is what we call a &lt;strong&gt;getter&lt;/strong&gt; method.&lt;/p&gt;

&lt;h3&gt;
  
  
  A getter method returns the value of an instance variable.
&lt;/h3&gt;

&lt;p&gt;In the previous example, we had the &lt;code&gt;name&lt;/code&gt; method simply return &lt;code&gt;@name&lt;/code&gt;. However, if you wanted  &lt;code&gt;@name&lt;/code&gt; to be returned in a certain format, you can easily achieve that by customizing your getter method.&lt;/p&gt;

&lt;p&gt;Let's write a custom getter method that returns &lt;code&gt;dog.name&lt;/code&gt; in all caps:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;upcase&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tomi'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; #&amp;lt;Dog:0x00007fb7475df010 @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; "TOMI"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that here, &lt;code&gt;@name&lt;/code&gt; itself is not modified. We’ve simply defined a method that returns &lt;code&gt;@name&lt;/code&gt; in the desired format.&lt;/p&gt;

&lt;p&gt;Say we initialize a &lt;code&gt;Dog&lt;/code&gt; instance but realize we have made a typo! If we try to reset &lt;code&gt;name&lt;/code&gt;, we'll get a &lt;code&gt;NoMethodError&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tomu'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Whoops!&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Tomi'&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; NoMethodError: undefined method `name=' for #&amp;lt;Dog:0x00007fb7483dd9a0 @name="Tomu"&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Similar to how we need to define a getter method to read the &lt;code&gt;@name&lt;/code&gt; value, we also need a method to set &lt;code&gt;@name&lt;/code&gt; a value. Though we're setting the value of &lt;code&gt;@name&lt;/code&gt; on initialize, we don't have anything in place to change it later.&lt;/p&gt;

&lt;p&gt;We need a &lt;strong&gt;setter method&lt;/strong&gt;!&lt;/p&gt;

&lt;h3&gt;
  
  
  A setter method sets the value of an instance variable.
&lt;/h3&gt;

&lt;p&gt;Let's create a setter method that allows us to change the name attribute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="c1"&gt;# Getter method&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="c1"&gt;# Setter method&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice that a setter method follows the format &lt;code&gt;def attribute=(attribute)&lt;/code&gt;. Now with a setter method, we can easily update the value of &lt;code&gt;@name&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tomuu'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Tomi'&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; #&amp;lt;Dog:0x00007fb7483dd9a0 @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What is &lt;code&gt;attr_accessor&lt;/code&gt;, &lt;code&gt;attr_writer&lt;/code&gt;, and &lt;code&gt;attr_reader&lt;/code&gt;?
&lt;/h2&gt;

&lt;p&gt;Now that we understand the basics of how data is stored and accessed in a Ruby class, let’s revisit the original question. What are these &lt;code&gt;attr&lt;/code&gt; methods? Well... they're ✨magic✨!&lt;/p&gt;

&lt;p&gt;Getting and setting an attribute of a class is a pretty basic operation. If we want a &lt;code&gt;Dog&lt;/code&gt; class that has &lt;code&gt;name&lt;/code&gt;, &lt;code&gt;breed&lt;/code&gt;, &lt;code&gt;age&lt;/code&gt;, and any number of attributes, we need a getter and setter method for each of these attributes. Writing methods for something very simple can quickly get very repetitive.&lt;/p&gt;

&lt;p&gt;You might've heard of Ruby as a very developer-friendly language. Aside from being very human-readable, Ruby aims to make our lives easier via metaprogramming. In other words, as a programming language, Ruby takes care of a lot of things so that developers don't have to! &lt;code&gt;attr&lt;/code&gt; methods are one of those things.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;code&gt;attr_accessor&lt;/code&gt; provides a shorthand way to define getter and setter methods for specified attributes.
&lt;/h3&gt;

&lt;p&gt;Desired attributes are passed in to &lt;code&gt;attr&lt;/code&gt; methods as a symbol:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;

    &lt;span class="nb"&gt;attr_accessor&lt;/span&gt; &lt;span class="ss"&gt;:name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:breed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:age&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
      &lt;span class="vi"&gt;@breed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;breed&lt;/span&gt;
      &lt;span class="vi"&gt;@age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With a single &lt;code&gt;attr_accessor :name, :breed, :age&lt;/code&gt; line, we were able to define six methods!&lt;/p&gt;

&lt;p&gt;&lt;code&gt;attr_accessor&lt;/code&gt; combines &lt;code&gt;attr_reader&lt;/code&gt; and &lt;code&gt;attr_writer&lt;/code&gt;. If you only want to shorthand a getter method, you can use &lt;code&gt;attr_reader&lt;/code&gt;. If you want to shorthand a writer method, you can use &lt;code&gt;attr_writer&lt;/code&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;attr_accessor&lt;/code&gt; - creates a getter and setter method&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;attr_reader&lt;/code&gt; - creates a getter method only&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;attr_writer&lt;/code&gt; - creates a setter method only&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It might make sense to use &lt;code&gt;attr_reader&lt;/code&gt; or &lt;code&gt;attr_writer&lt;/code&gt; in situations where we want to customize one method, but not the other.&lt;/p&gt;

&lt;h3&gt;
  
  
  Example: We want &lt;code&gt;dog.age&lt;/code&gt; to return &lt;code&gt;@age&lt;/code&gt; in a certain format, but don't want to change how &lt;code&gt;@age&lt;/code&gt; is stored.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;

    &lt;span class="nb"&gt;attr_accessor&lt;/span&gt; &lt;span class="ss"&gt;:name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:breed&lt;/span&gt;
    &lt;span class="nb"&gt;attr_writer&lt;/span&gt; &lt;span class="ss"&gt;:age&lt;/span&gt; &lt;span class="c1"&gt;# Default setter method to set @age&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
      &lt;span class="vi"&gt;@breed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;breed&lt;/span&gt;
      &lt;span class="vi"&gt;@age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="c1"&gt;# Defining our own getter method to return a formatted age&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;age&lt;/span&gt;
      &lt;span class="s2"&gt;"Age &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="vi"&gt;@age&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tomi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'pug'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; #&amp;lt;Dog:0x00007fb72debcdf0 @age=2, @breed="pug", @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;age&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; "Age 2"&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; #&amp;lt;Dog:0x00007fb72debcdf0 @age=2, @breed="pug", @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Example: We want &lt;code&gt;@age&lt;/code&gt; to always be set in a certain format.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;
  &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Dog&lt;/span&gt;

    &lt;span class="nb"&gt;attr_accessor&lt;/span&gt; &lt;span class="ss"&gt;:name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ss"&gt;:breed&lt;/span&gt;
    &lt;span class="nb"&gt;attr_reader&lt;/span&gt; &lt;span class="ss"&gt;:age&lt;/span&gt; &lt;span class="c1"&gt;# Default getter method to read @age&lt;/span&gt;

    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;breed&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;name&lt;/span&gt;
      &lt;span class="vi"&gt;@breed&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;breed&lt;/span&gt;
      &lt;span class="vi"&gt;@age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Age &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="c1"&gt;# Set @age to age in desired format.&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

    &lt;span class="c1"&gt;# Defining our own setter method so @age is always set in desired format&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;age&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="vi"&gt;@age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Age &lt;/span&gt;&lt;span class="si"&gt;#{&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;

  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight ruby"&gt;&lt;code&gt;&lt;span class="n"&gt;dog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;Dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'Tomi'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'pug'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; #&amp;lt;Dog:0x00007fb73383efe0 @age="Age 2", @breed="pug", @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;3&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; 3&lt;/span&gt;
&lt;span class="n"&gt;dog&lt;/span&gt;
&lt;span class="c1"&gt;#=&amp;gt; #&amp;lt;Dog:0x00007fb73383efe0 @age="Age 3", @breed="pug", @name="Tomi"&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Instance variables hold data in a Ruby class instance.&lt;/li&gt;
&lt;li&gt;Instance variables can only be directly accessed within a Ruby class.&lt;/li&gt;
&lt;li&gt;To access an instance variable outside of a Ruby class, we must define methods.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;attr_reader&lt;/code&gt;, &lt;code&gt;attr_writer&lt;/code&gt;, and &lt;code&gt;attr_accessor&lt;/code&gt; are convenient shorthands for writing
getter and setter methods.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>ruby</category>
      <category>beginners</category>
      <category>rails</category>
    </item>
    <item>
      <title>Podcasts are GAMECHANGING for learning! 🗣💻🎧</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Sun, 18 Oct 2020 01:06:02 +0000</pubDate>
      <link>https://forem.com/kateh/why-i-love-podcasts-4a4d</link>
      <guid>https://forem.com/kateh/why-i-love-podcasts-4a4d</guid>
      <description>&lt;p&gt;Discuss: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Do you have any favorite tech or software engineering related podcasts?&lt;/li&gt;
&lt;li&gt;What do you like about it?&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  I absolutely LOVE podcasts.
&lt;/h2&gt;

&lt;p&gt;I find myself listening to podcasts whenever I’m grocery shopping, walking, running, or even folding laundry. Unlike books or videos, podcasts offer the convenience of being listened to on-the-go. &lt;/p&gt;




&lt;p&gt;Despite listening to podcasts for years, I actually never listened to tech or software engineering related podcasts.&lt;/p&gt;

&lt;p&gt;I'm not sure why but I think I might've had some preconceived notion that software engineering or coding podcasts would be a bit dry, kind of like listening to a lecture. &lt;/p&gt;

&lt;p&gt;However, as I've recently discovered, that is absolutely not the case! There’s a HUGE variety of content whether it be related to a specific technology or topic within software engineering or a career question. Wherever you are in your coding journey, you're bound to find something that's interesting and insightful to you.&lt;/p&gt;

&lt;p&gt;Listening to podcasts have expanded my world of software engineering in a strange way. There are hundreds and thousands of people who code around the world, all with interesting perspectives and ideas which we may not come across in our day to day. Especially for those who are early in their careers, it can be pretty eye-opening and oddly comforting to realize that a lot of the questions we have or the problems we're trying to solve at work are actually not that unique. Podcasts can be a great way to expand your perspective and gain exposure to the communities and people outside of our everyday. &lt;/p&gt;

&lt;p&gt;I had always turned exclusively to books, blogposts, and videos as a learning resource so podcasts have been an absolute game changer! &lt;/p&gt;

&lt;p&gt;Outside of serving as a great learning resource, I appreciate that some podcasts have a casualness that make them fun to listen to.&lt;/p&gt;

&lt;h2&gt;
  
  
  A few of my favorites include...
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. &lt;a href="https://softskills.audio/"&gt;Soft Skills Engineering&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Their tagline is: &lt;br&gt;
&lt;em&gt;"It takes more than great code to be a great engineer."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The soft skills side of engineering isn't something that's actively taught in school or bootcamps, but it's actually pretty important! The show covers topics like pay raises, getting promoted, 1 on 1's with managers, which are all pretty universal topics that are important. To give a general sense, some episode titles include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Declining job offers and being the outside hire&lt;/li&gt;
&lt;li&gt;Stuck on the ladder and can't say no&lt;/li&gt;
&lt;li&gt;Unpaid team lead and banking hours&lt;/li&gt;
&lt;li&gt;One-on-ones and inter-team power struggles&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As a plus, the hosts are pretty entertaining and it can be a light-hearted listen. &lt;/p&gt;

&lt;h3&gt;
  
  
  2. &lt;a href="https://www.codenewbie.org/"&gt;CodeNewbie&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Their tagline is: &lt;br&gt;
&lt;em&gt;“The most supportive community of programmers and people learning to code”&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Though the name of this show is, “Code Newbie”, you don’t  have to be a newbie to enjoy this show! What I really appreciate about this show is the diverse range of guests and topics. Each episode features a different guest who is pretty passionate about a certain topic. This in turn gets me interested in something new I might not have known much about before. To give a general sense, some episode titles include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Why you shouldn’t forget about CSS&lt;/li&gt;
&lt;li&gt;Why you should consider learning Ruby&lt;/li&gt;
&lt;li&gt;How to not get bogged down in technical debt&lt;/li&gt;
&lt;li&gt;What does ageism in tech look like?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I also like how their guests share their story about how they came to code.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. &lt;a href="https://www.programmingthrowdown.com/"&gt;Programming Throwdown&lt;/a&gt;
&lt;/h3&gt;

&lt;p&gt;Their description says:&lt;br&gt;
&lt;em&gt;"Programming Throwdown attempt to educate Computer Scientists and Software Engineers on a cavalcade of programming and tech topics."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I really love this show for getting a high-level introduction into various topics of software engineering I might not be very familiar with. The episodes are a little over an hour long but I think the hosts do a great job of making their content digestible and interesting to follow. To give a general sense, some episode titles include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Working from Home&lt;/li&gt;
&lt;li&gt;DevOps and Site Reliability&lt;/li&gt;
&lt;li&gt;Terminal and Shells&lt;/li&gt;
&lt;li&gt;Teaching Kids to Code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A lot of their older episodes are focused on a specific programming language like Javascript, Ruby, Go, C++, Java. &lt;/p&gt;

&lt;h3&gt;
  
  
  Bonus
&lt;/h3&gt;

&lt;p&gt;I work with Ruby on Rails in my day-to-day. I've really listening to &lt;a href="https://5by5.tv/rubyonrails"&gt;Rails 5by5&lt;/a&gt; and &lt;a href="https://devchat.tv/podcasts/ruby-rogues/"&gt;Ruby Rogues&lt;/a&gt;! It's super insightful to hear of the challenges other Ruby on Rails developers and teams face. I'm often surprised at how relevant the topics are with whatever I'm dealing with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Disclaimer: No one's paying me to recommend these shows (unfortunately, lol)&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  In Conclusion
&lt;/h2&gt;

&lt;p&gt;I really enjoy listening to podcasts. They've expanded my world of software engineering. &lt;/p&gt;

&lt;p&gt;We all have our own preferences and styles of learning! While I love podcasts, I know others who can't stand them and would much rather read a blog post. However, if you've never given software engineering or coding related podcasts a try, I highly recommend you give one a listen!&lt;/p&gt;

&lt;p&gt;Feel free to recommend me your favorite coding/tech/career-related podcast and what you love about it! &lt;/p&gt;




&lt;p&gt;&lt;span&gt;Photo by &lt;a href="https://unsplash.com/@timmossholder?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Tim Mossholder&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/learning?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>codenewbie</category>
      <category>beginners</category>
      <category>career</category>
    </item>
    <item>
      <title>What *is* an Operating System?</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Sun, 11 Oct 2020 19:30:27 +0000</pubDate>
      <link>https://forem.com/kateh/eli5-what-is-an-operating-system-1082</link>
      <guid>https://forem.com/kateh/eli5-what-is-an-operating-system-1082</guid>
      <description>&lt;p&gt;&lt;em&gt;If you've heard of "operating system", but nothing comes to mind beyond "Mac and Windows?", then this post is for you!&lt;/em&gt; &lt;/p&gt;




&lt;h2&gt;
  
  
  "Mac, Windows, or Linux?"
&lt;/h2&gt;

&lt;p&gt;This has go to be one of the most &lt;em&gt;frequently&lt;/em&gt; debated topics on the Internet. These are a reference to the most popular &lt;em&gt;operating systems&lt;/em&gt; in the world.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;But what do we mean by an operating system?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we get into it, let's talk briefly about the three most popular desktop operating systems you're likely familiar with!&lt;/p&gt;

&lt;h3&gt;
  
  
  macOS (previously known as OS X)
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fphotos5.appleinsider.com%2Fgallery%2F29370-47319-000-3x2-Apple-History-Mac-launch-xl.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fphotos5.appleinsider.com%2Fgallery%2F29370-47319-000-3x2-Apple-History-Mac-launch-xl.jpg" alt="First Mac OS"&gt;&lt;/a&gt;&lt;/p&gt;
First Mac OS 



&lt;p&gt;macOS is a &lt;em&gt;unix-based&lt;/em&gt; operating system owned and distributed by Apple Inc. The first Mac OS was introduced back in 1984. In fact, it was introduced during the super bowl with &lt;a href="https://www.youtube.com/watch?v=VtvjbmoDx-I" rel="noopener noreferrer"&gt;this extremely eerie commercial&lt;/a&gt; which alludes to George Orwell's 1984... &lt;/p&gt;

&lt;p&gt;As Apple &lt;a href="https://www.apple.com/macos/what-is/#:~:text=macOS%20is%20the%20operating%20system,suite%20of%20beautifully%20designed%20apps." rel="noopener noreferrer"&gt;states&lt;/a&gt; on their website, macOS is designed specifically to run with Apple hardware. While Windows and Linux can run on a variety of PC hardware, macOS &lt;strong&gt;must&lt;/strong&gt; run on Apple hardware, giving it exclusivity and a higher cost barrier. &lt;/p&gt;

&lt;p&gt;While there are &lt;a href="https://www.macworld.co.uk/how-to/mac-software/install-macos-pc-3632329/" rel="noopener noreferrer"&gt;tutorials&lt;/a&gt; out there that may teach you how to configure macOS on a PC, Apple does not want you to. In fact, it's technically illegal 😅... &lt;/p&gt;

&lt;h3&gt;
  
  
  Windows
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fa%2Fa9%2FMicrosoft_Windows_1.0_page1.jpg%2F399px-Microsoft_Windows_1.0_page1.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fa%2Fa9%2FMicrosoft_Windows_1.0_page1.jpg%2F399px-Microsoft_Windows_1.0_page1.jpg" alt="Windows 1.0 Advertisement"&gt;&lt;/a&gt; &lt;/p&gt;
Windows 1.0 Advertisement



&lt;p&gt;Windows refers to the series of operating systems developed by Microsoft first released in 1985. Here's &lt;a href="https://www.youtube.com/watch?v=sforhbLiwLA" rel="noopener noreferrer"&gt;another VERY interesting ad&lt;/a&gt; from 1986... &lt;/p&gt;

&lt;p&gt;While macOS and Linux can be traced back to &lt;a href="https://www.techopedia.com/definition/4637/unix#:~:text=Unix%20is%20a%20portable%2C%20multitasking,reprogrammed%20in%20C%20in%201973.&amp;amp;text=Unix%20operating%20systems%20are%20widely,PCs%2C%20servers%20and%20mobile%20devices." rel="noopener noreferrer"&gt;unix&lt;/a&gt;, Windows is an entirely separate family.&lt;/p&gt;

&lt;p&gt;Most PC computers come pre-installed with Windows. This can be traced back to the &lt;a href="https://en.wikipedia.org/wiki/Wintel" rel="noopener noreferrer"&gt;Wintel alliance&lt;/a&gt;. This was an alliance between Windows and Intel where the two pretty much joined forces in an effort to be at the forefront of personal computers, and get Windows software &amp;amp; Intel hardware into every house, school, and workplace... &lt;/p&gt;

&lt;p&gt;Windows is by far the most popular desktop operating system in the world! This &lt;a href="https://gs.statcounter.com/os-market-share/desktop/worldwide" rel="noopener noreferrer"&gt;site&lt;/a&gt; estimates that Windows accounts for 77% of desktop operating systems worldwide. &lt;/p&gt;

&lt;h3&gt;
  
  
  Linux
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F3%2F35%2FTux.svg%2F1200px-Tux.svg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F3%2F35%2FTux.svg%2F1200px-Tux.svg.png" alt="Tux, the Linux kernel mascot"&gt;&lt;/a&gt; &lt;/p&gt;
Tux, the Linux kernel mascot



&lt;p&gt;Linux refers to a family of unix-like open-source &lt;em&gt;operating systems&lt;/em&gt; based on the &lt;strong&gt;Linux kernel&lt;/strong&gt;. You can think of a kernel as one of the most important component of an operating system! This kernel was developed by a Finnish engineering student named Linus Torvalds in 1991. &lt;/p&gt;

&lt;p&gt;What sets linux apart is it's open-source nature and community backing. You might've heard of linux being very popular with hackers. Anyone can view and contribute to the linux kernel, or modify it as they please. In fact here's the linux kernel &lt;a href="https://github.com/torvalds/linux" rel="noopener noreferrer"&gt;repo on Github&lt;/a&gt;! Look at the crazy number of pull requests and contributor count....👀&lt;/p&gt;

&lt;p&gt;When people talk about linux, they are referring to either: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The different distributions, or flavors of linux operating systems which use the linux kernel.
&lt;/li&gt;
&lt;li&gt;the linux kernel itself&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Individuals and businesses can take this kernel code for free and use it as basis for their own operating system. Funfact: Android and Chrome OS use a modified version of the linux kernel! &lt;/p&gt;

&lt;p&gt;Linux kernel can be found in mobile and server operating systems as well. While linux-based operating systems account for &lt;a href="https://gs.statcounter.com/os-market-share/desktop/worldwide" rel="noopener noreferrer"&gt;less than 2%&lt;/a&gt; of desktop operating systems, they DOMINATE web servers with estimates ranging from 60%-98%.&lt;/p&gt;

&lt;p&gt;Popular distributions of the linux operating system include Ubuntu, CentOS, Debian, Fedora, Red Hat, Arch Linux, Kubuntu, Deepin...&lt;/p&gt;




&lt;p&gt;Of course, there's a LOT more to the history of how these operating systems were developed, what is meant by &lt;em&gt;unix&lt;/em&gt;, and the various similarities and differences, but that is impossible to cover in one blog post, so let's move on for now!&lt;/p&gt;

&lt;h2&gt;
  
  
  So what actually is an operating system?
&lt;/h2&gt;

&lt;p&gt;From &lt;a href="https://en.wikipedia.org/wiki/Operating_system" rel="noopener noreferrer"&gt;Wikipedia&lt;/a&gt;, &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Though I've focus more on desktop operating systems, operating systems are core to mobile phones, smart watches, tablets, and web servers.&lt;/p&gt;

&lt;p&gt;An interesting analogy I've come across a few times is that&lt;/p&gt;

&lt;h3&gt;
  
  
  An operating system is like the government.
&lt;/h3&gt;

&lt;p&gt;For a moment, set aside your thoughts about the current state of government and how well you think the government is actually working... and just think about all the things government is tasked to do.&lt;/p&gt;

&lt;p&gt;Government:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;allocates&lt;/strong&gt; money to different sectors of society like healthcare, education, scientific research, unemployment...&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;enforces&lt;/strong&gt; laws that tell us what we can and can’t do.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;provides&lt;/strong&gt; public services like public transportation, DMV, environmental protection... They're also in charge of maintaining infrastructures like traffic lights, roads, bridges so that people can get from place to place. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's a lot of &lt;em&gt;behind-the-scenes&lt;/em&gt; things government is tasked with taking care of so individuals don't have to. &lt;/p&gt;

&lt;p&gt;Now... operating systems have a very similar function, but within the realms of a computer. &lt;/p&gt;

&lt;p&gt;An operating system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;allocates&lt;/strong&gt; resources including memory and storage, and sets the schedules to allow tasks to run.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;enforces&lt;/strong&gt; rules that regulate the behavior of different processes. They also enforce security mechanisms to prevent misuse of computer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;provides&lt;/strong&gt; common services and functionalities that allow application softwares to run. This makes writing application software easier.
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;See the similarity?&lt;/p&gt;

&lt;h3&gt;
  
  
  Operating systems take care of a lot of details so that people don't have to.
&lt;/h3&gt;

&lt;p&gt;Operating systems provide a layer of abstraction between people and hardware. &lt;/p&gt;

&lt;p&gt;The earliest computers didn't have operating systems. In fact, getting a computer to work was an extremely manual process where multiple people would be tasked with toggling switches and punch paper cards just to get the computer to work. &lt;a href="https://www.howtogeek.com/196493/what-concepts-were-used-before-operating-systems/" rel="noopener noreferrer"&gt;You can read more about it here&lt;/a&gt;.  &lt;/p&gt;

&lt;p&gt;But today, when you're opening Chrome, you're not thinking about memory allocation or how the click of your mouse has to get interpreted and communicated to the computer hardware. You don't have to understand how microprocessors and chips work. Even if you're an &lt;em&gt;application software&lt;/em&gt; developer for say, Slack, you're not worrying about how your user is going to switch between your application and something else they have running like Excel or Chrome or Spotify. &lt;/p&gt;

&lt;p&gt;Let's dig into these last points a bit more.&lt;/p&gt;

&lt;h3&gt;
  
  
  What is an application software?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Application software&lt;/strong&gt; refers to software that is designed for a for a specific end-user purpose. These include browsers like Firefox, Safari, Internet Explorer, Google Chrome, and music listening programs like Spotify, and editing tools like Photoshop, Lightroom, or computer games like Minecraft...&lt;/p&gt;

&lt;p&gt;Whenever you're installing anything onto your computer, you're probably checking whether it's compatible with the operating system you're running on. &lt;/p&gt;

&lt;p&gt;The reason we have to do this is because application software  rely on the core &lt;strong&gt;services&lt;/strong&gt; provided by the operating system. Therefore, application software developers develop for a specific OS.&lt;/p&gt;

&lt;p&gt;Good luck trying to install the first release of Microsoft Paint intended for Windows 1.0 in 1985 on your macOS. Heck, good luck running that release of Microsoft Paint on any recent Windows OS version!!! &lt;/p&gt;

&lt;p&gt;If you've been skipping your computer's OS updates, you might have trouble running new applications. This all boils down to application software being dependent on a particular operating system environment.&lt;/p&gt;

&lt;p&gt;You can't stick a VCR tape into a DVD player and expect a movie to play... &lt;/p&gt;

&lt;p&gt;You can't attach bike wheels to a car and expect the car to run... &lt;/p&gt;

&lt;p&gt;You get the idea!&lt;/p&gt;

&lt;h2&gt;
  
  
  Main Takeaway
&lt;/h2&gt;

&lt;p&gt;✅ Operating systems take care of a lot of behind-the-scenes operations.&lt;br&gt;
✅ Operating systems bridge the communication between human users and hardware.&lt;br&gt;
✅ Operating systems provide a common set of services and functionalities that enable application software developers to write programs easily.  &lt;/p&gt;




&lt;p&gt;Thanks for giving this a read! I've never taken an operating systems course, nor have I really taken time to dig into what we mean by operating system. This post is my understanding of operating systems as someone &lt;em&gt;very&lt;/em&gt; new to this topic...&lt;/p&gt;

&lt;p&gt;Even digging into the history, there's a lot of nuance! If there's anything that seems off, please let me know.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Side note: anyone remember this Epic Rap Battles of History Steve Jobs vs Bill Gates episode from &lt;a href="https://www.youtube.com/watch?v=njos57IJf-0" rel="noopener noreferrer"&gt;2012&lt;/a&gt;...?&lt;/em&gt;&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>todayilearned</category>
      <category>computerscience</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>What are our responsibilities as software developers beyond writing code? 🌎💻</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Sat, 03 Oct 2020 20:53:05 +0000</pubDate>
      <link>https://forem.com/kateh/beyond-writing-code-what-are-our-ethical-responsibilities-al7</link>
      <guid>https://forem.com/kateh/beyond-writing-code-what-are-our-ethical-responsibilities-al7</guid>
      <description>&lt;p&gt;Discuss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;How has tech shaped our society? Your life? &lt;/li&gt;
&lt;li&gt;What ethical responsibilities do we have as software developers?&lt;/li&gt;
&lt;li&gt;What are ways you keep yourself accountable in your day to day? &lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Today, it’s impossible to think of a world without any influence of code.
&lt;/h2&gt;

&lt;p&gt;I grew up in the age of rising social media. In 2009, I created my first social media account via Facebook. I was only in middle school. &lt;/p&gt;

&lt;p&gt;I know. Middle school feels too early. &lt;/p&gt;

&lt;p&gt;Surprisingly though, most of my classmates were on Facebook and I simply didn't want to miss out. I still remember the initial feelings of wariness I had when first registering my profile. &lt;em&gt;Should I use a fake name? Should I even have my full name on the web? Is this safe?&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I was cautious. But with an easy click of a button, I entered a new world and that wariness went away. &lt;/p&gt;

&lt;p&gt;Snapchat, Instagram, Twitter, LinkedIn... has there been a week that went by in the past twelve years where I didn't check some form of social media? Probably not. &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Thousands of hours of mindless scrolling since middle school. Damn.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Nothing is black and white.
&lt;/h3&gt;

&lt;p&gt;Social media has given me an outlet to stay connected with friends who are far away and has helped me maintain a sense of humanity during this isolating age of quarantine. &lt;/p&gt;

&lt;p&gt;I've increasingly relied on the convenience provided by companies like Uber, Lyft, AirBnB, and Amazon. With a click of a button I can have products delivered to me next day. Within five minutes, I can have a driver come pick me up and take me wherever I want to be. If I want Mexican food, I can take out my phone and do a quick search filtering out the lower rated places. How convenient! &lt;/p&gt;

&lt;p&gt;But there's a lot we ignore behind this convenience. &lt;/p&gt;




&lt;h2&gt;
  
  
  Taking part in the creation
&lt;/h2&gt;

&lt;p&gt;In college, I took computer science courses. I studied Data Structures, Discrete Mathematics, Algorithms, Databases... I attended engineering career fairs. I remember packing into the auditorium with hundreds of other students. There were long lines before every booth just to chat with recruiters. Recruiters pitched fancy offices, free food perks, and appealed to bright-eyed students promising "interesting engineering problems". Never in my classes, nor these conversations with recruiters, did the ethics of software development, nor the potential consequences behind code come up.&lt;/p&gt;

&lt;h3&gt;
  
  
  As software engineers, we are programmed to think about ways we can automate tasks with code.
&lt;/h3&gt;

&lt;p&gt;In fact, that's what we get paid for. At times, writing code can feel like a separate thing from the "real" world. In our day to day, when we're simply tackling the micro-level problems at hand, it's hard to see the macro-level impact we have. In reality, we're building products that change everyday experiences of real people. The code we write can potentially shape the habits of even young kids. But that's not what we think about when we're writing code.&lt;/p&gt;

&lt;p&gt;For some, writing code is simply a means to make a living, nothing more. Developers can argue that the larger responsibility of the different consequences behind the code we write may lie on business people who make the larger decisions, or the product designers... But is that really true? &lt;/p&gt;

&lt;p&gt;If we churn out code without ever stopping to think about the higher-level implications of the code we're writing, the motivations behind the companies we work for, what impact do we have? &lt;/p&gt;

&lt;p&gt;What kind of society are we creating?&lt;/p&gt;




&lt;p&gt;Thanks for reading until the end. Ethics and the influence of tech and code is something I often think about. At the same time, I don't really know how to think about it... What are you thoughts?  &lt;/p&gt;

</description>
      <category>discuss</category>
      <category>career</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Lessons learned from a weekend wrestling CSS for a dropdown menu...</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Mon, 28 Sep 2020 05:42:45 +0000</pubDate>
      <link>https://forem.com/kateh/lesson-learned-there-s-a-reason-for-bootstrap-and-other-css-frameworks-3fl1</link>
      <guid>https://forem.com/kateh/lesson-learned-there-s-a-reason-for-bootstrap-and-other-css-frameworks-3fl1</guid>
      <description>&lt;p&gt;TLDR; There's a good reason to use bootstrap and CSS frameworks&lt;/p&gt;




&lt;p&gt;This weekend, I decided to explore what a CSS-only, accessible dropdown menu component might look like by following some tutorials I found. My hope was to tackle my discomfort with CSS and if I was lucky, end up with a no-JS dropdown menu component that could replace a bootstrap dropdown menu.&lt;/p&gt;

&lt;p&gt;However, it is Sunday night and my weekend is nearing an end. I definitely got to a good place with CSS-only and learned a lot. Yet, the dropdown menu I ended up with is far from being able to replace what bootstrap does! What I have is a partially-accessible component... This past weekend, I've learned some important lessons around how much work may go into creating  a seemingly simple UI component from scratch.&lt;/p&gt;

&lt;h3&gt;
  
  
  Preface
&lt;/h3&gt;

&lt;p&gt;I don’t work too much with CSS in my day-to-day. I am a full-stack developer on a small engineering team spending most of my time in Ruby code. Some time ago, I would spend hours in my free time creating &lt;a href="https://codepen.io/khiga8/pens/popular"&gt;CSS art&lt;/a&gt;,&lt;br&gt;
for no other reason than: it's fun and looks cool! Needless to say, my working CSS knowledge is very lacking.&lt;/p&gt;
&lt;h3&gt;
  
  
  Exploration
&lt;/h3&gt;

&lt;p&gt;I came across these neat CSS-only dropdown tutorial:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://css-tricks.com/solved-with-css-dropdown-menus/"&gt;Solved with CSS! Dropdown Menus&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://moderncss.dev/css-only-accessible-dropdown-navigation-menu/"&gt;CSS Only Accessible Dropdown Navigation Menu&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;CSS only and accessible??!!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This sounded great! If it's possible to create a CSS-only dropdown menu, I figured it was worth an exploration!&lt;/p&gt;

&lt;p&gt;I lightly followed the above tutorials while being mindful not to blindly copy lines. First and foremost, my goal was learning and understanding what went behind each CSS rule and selectors. After I had a general understanding of what the selectors were and what the rules meant, I started tweaking around! I got lost in this....working with CSS is an entirely different beast from other types of programming work.&lt;/p&gt;
&lt;h3&gt;
  
  
  Lessons Learned
&lt;/h3&gt;

&lt;p&gt;It’s Sunday night and nearing the end of the weekend. I am pretty proud of what I ended up with and all I've learned. Below I have a left-aligned dropdown, right-aligned dropdown, and some icon dropdowns which would fit my need. &lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/khiga8/embed/NWNJEoz?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;But the reality is, there's a lot this implementation is missing even comparing it to a bootstrap dropdown menu. Like everything else in software development, developing UI isn't just about making something that's working for you on your screen.&lt;/p&gt;

&lt;p&gt;Even after creating something that “works” and is looking nice, there’s a few more things to think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is the element FULLY accessible? Does it have correct tab focus, keyboard arrow support, appropriate aria role....It turns out CSS-alone isn't enough for a fully compliant accessible dropdown! There needs to be JS to update the &lt;code&gt;aria-expanded&lt;/code&gt; attributes. &lt;/li&gt;
&lt;li&gt;Is the element mobile friendly? But again, what does a mobile friendly dropdown menu look like?&lt;/li&gt;
&lt;li&gt;What about browser support? For example, for this CSS dropdown, I used the pseudo &lt;code&gt;:focus-within&lt;/code&gt; but turns out this isn't supported in IE which I would need to care about. Is there a polyfill available?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The time, resources, and domain-specific knowledge that's required to build up a fully accessible UI element is something that should NOT be underestimated. It isn't just about creating something that "works", but thinking about accessibility, browser compatibility, being attuned to various browser bugs, and making thoughtful implementation decisions for the various usages of the UI element. There's a reason smaller teams rely on bootstrap, and there's a lot to ask yourself before building your own.&lt;/p&gt;

&lt;p&gt;With all that said, this deep-dive via trying to create a custom CSS dropdown menu component was a lot of fun! It got me thinking about the various implementation details and decisions that have been abstracted away by third party libraries. What are the benefits of these third party libraries? What are the trade offs? There's a lot to think about!&lt;/p&gt;




&lt;p&gt;Thanks for reading till the end! Apologies if this turned out to be a bit of a ramble!&lt;/p&gt;

&lt;p&gt;Curious to know:&lt;/p&gt;

&lt;p&gt;1) What tools do you or your team use for UI development? Why?&lt;br&gt;
2) When might it make sense to rely on a third party UI framework/library vs building out and maintaining a custom one?&lt;br&gt;
3) What are your favorite ways to learn and get comfy with CSS?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;BONUS&lt;/strong&gt;: Any favorite CSS tricks?&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>css</category>
      <category>todayilearned</category>
    </item>
    <item>
      <title>Intro to Keyboard A11y: An (interactive) guide to Tab &amp; Tabindex 🗂⌨️🗺</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Sat, 19 Sep 2020 22:45:46 +0000</pubDate>
      <link>https://forem.com/kateh/introduction-to-tab-navigation-and-the-3-tabindex-4m3m</link>
      <guid>https://forem.com/kateh/introduction-to-tab-navigation-and-the-3-tabindex-4m3m</guid>
      <description>&lt;p&gt;&lt;em&gt;Note: You will want to skip the "interactive" portions of this guide if you are on a mobile device.&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;Developers are all about keyboard shortcuts! Being savvy with the keyboard helps us be more effective, and honestly just feels pretty cool... But today, I want to deep-dive into keyboard navigation in the context of &lt;em&gt;accessibility&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Many different people rely on keyboard navigation as a sole means for navigation for any number of reasons. It's important that a web page is 100% accessible with a keyboard.&lt;/p&gt;

&lt;p&gt;In particular, the &lt;strong&gt;tab&lt;/strong&gt; key plays a critical role in allowing a keyboard user to navigate through a page.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;tab&lt;/strong&gt; - focus on the next element&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;shift+tab&lt;/strong&gt; - focus on the previous element&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're unfamiliar with tab navigation, you're not alone! Personally, I had no idea what tab navigation was until very recently. If you've never tried tab navigation, take a moment &lt;strong&gt;right now&lt;/strong&gt; to press the tab key a few times, and try navigating around this current web page! &lt;em&gt;See you in a bit!&lt;/em&gt; &lt;/p&gt;

&lt;p&gt;👋&lt;/p&gt;

&lt;p&gt;👋&lt;/p&gt;

&lt;p&gt;Welcome back! Did you get the chance to tab around?&lt;/p&gt;

&lt;p&gt;You might have noticed your focus first jumped to the very top left of this page. Then as you pressed the tab key, the focus should have moved in a somewhat &lt;strong&gt;logical&lt;/strong&gt; order from left to right, top to bottom. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remember, an accessible page has a logical tab order.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Can you imagine how frustrating it would be if the the focus jumped around the page in some arbitrary order? That confusion would be amplified for people who rely on a screen reader to announce where they are within a page. As an exercise, you can try tabbing around &lt;a href="https://www.w3.org/WAI/demos/bad/before/home.html"&gt;this terribly inaccessible web page&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  But who decides the order!?
&lt;/h2&gt;

&lt;p&gt;The good news is, HTML has built-in tab focus behavior so we usually don't need to worry about manually specifying a tab order. &lt;/p&gt;

&lt;p&gt;By default,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tab navigation follows the logical order of elements in the DOM. &lt;/li&gt;
&lt;li&gt;Interactive HTML elements such as form inputs, links, and buttons are included in tab order, while non-interactive elements such as divs and paragraph tags are excluded.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What is tabindex?
&lt;/h2&gt;

&lt;p&gt;There may be times you want to override the default tab or focus behavior. This is when the &lt;code&gt;tabindex&lt;/code&gt; attribute comes into play. The default tab behavior of any HTML element can be overridden by setting the tabindex attribute!&lt;/p&gt;

&lt;h2&gt;
  
  
  tabindex 0
&lt;/h2&gt;

&lt;p&gt;By setting tabindex to 0, an element that is not usually part of the tab order, such as a &lt;code&gt;&amp;lt;div /&amp;gt;&lt;/code&gt; can be made focusable and added to the tab order. &lt;/p&gt;

&lt;p&gt;Confused? See it in action:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/khiga8/embed/ZEWqmoB?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Usecase
&lt;/h3&gt;

&lt;p&gt;Tabindex 0 could come in handy if you have a custom interactive element that is not natively focusable. An example may be a &lt;code&gt;&amp;lt;div /&amp;gt;&lt;/code&gt; element that, for whatever reason, needs to act as a button. (Ideally though, you should use the &lt;code&gt;&amp;lt;button /&amp;gt;&lt;/code&gt; tag but if for whatever reason, you cannot, you can mimic the native tab behavior of a button by setting the tabindex). &lt;/p&gt;

&lt;p&gt;&lt;em&gt;Do you know of other usecases for tabindex 0? Let me know down below!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  tabindex negative
&lt;/h2&gt;

&lt;p&gt;When a tabindex is set to a negative number (usually -1), an element may be removed from the tab order. It's important to note that even if the element is removed from the tab order, it can still receive focus programmatically with javascript's &lt;code&gt;focus&lt;/code&gt; method. &lt;/p&gt;

&lt;p&gt;Confused? See the negative tabindex in action:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/khiga8/embed/BaKqGbB?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Usecase
&lt;/h3&gt;

&lt;p&gt;A negative tabindex can be helpful for something like a modal which is usually inside a &lt;code&gt;&amp;lt;div/&amp;gt;&lt;/code&gt; element. We can prevent a keyboard user from focusing on a hidden modal by setting the tabindex to -1. However, when the modal is shown, a programmatic focus can be set using javascript to allow the user to interact with the modal!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Do you know of other usecases for negative tabindex? Let me know down below!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  tabindex positive
&lt;/h2&gt;

&lt;p&gt;Last, and perhaps also the least, a positive tabindex is used to specify the exact tab order of an element. &lt;/p&gt;

&lt;p&gt;Confused? See what I mean:&lt;/p&gt;

&lt;p&gt;&lt;iframe height="600" src="https://codepen.io/khiga8/embed/BaKqGea?height=600&amp;amp;default-tab=result&amp;amp;embed-version=2"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;h3&gt;
  
  
  Usecase
&lt;/h3&gt;

&lt;p&gt;I haven't actually encountered a valid usecase for setting a positive tabindex... All guides I've encountered list it as something you should never do. 🤷🏻‍♀️&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Do you have a valid usecase for positive tabindex? Let me know down below!&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  To wrap it up..
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Tab navigation is essential for keyboard users. &lt;/li&gt;
&lt;li&gt;Tab order must be logical.&lt;/li&gt;
&lt;li&gt;Using the correct HTML tag usually takes care of most tab order concerns.&lt;/li&gt;
&lt;li&gt;You can set tabindex to 0, a negative number, or a positive number, to override the tab behavior for any element. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I found these resources extremely helpful!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://webaim.org/techniques/keyboard/tabindex"&gt;WebAIM&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex"&gt;MDN&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://developers.google.com/web/fundamentals/accessibility/focus/using-tabindex"&gt;Google Web Fundamentals&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;Thanks for reading until the end. I'm very early in my learning of best accessibility practices. Is there anything else I should know or anything I didn't get quite right? If you have any thoughts or comments, let me know down below!&lt;/p&gt;

</description>
      <category>a11y</category>
      <category>beginners</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Awesome resources to learn more about accessibility 📚⚒️</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Wed, 16 Sep 2020 00:31:34 +0000</pubDate>
      <link>https://forem.com/kateh/awesome-resources-to-learn-more-about-accessibility-13of</link>
      <guid>https://forem.com/kateh/awesome-resources-to-learn-more-about-accessibility-13of</guid>
      <description>&lt;p&gt;As developers, we have the power to shape experiences with code. We learn about data structures, algorithms, databases, testing, security.... yet accessibility isn't something that's seen as &lt;strong&gt;core&lt;/strong&gt; to engineering. More often than not, a lot of us — including myself — make assumptions about our users and write code based on those assumptions.&lt;/p&gt;

&lt;p&gt;Recently, I decided to deep-dive into best web accessibility practices. I've discovered that there are tons of amazing resources and tools out there! &lt;/p&gt;

&lt;p&gt;Here are some that I've found extremely helpful in aiding my learning! &lt;/p&gt;

&lt;h2&gt;
  
  
  Articles &amp;amp; Blog posts 📑:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.w3.org/WAI/fundamentals/accessibility-intro/"&gt;Intro to Web Accessibility&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Two from &lt;a href="https://dev.to/maxwell_dev"&gt;Max Antonucci&lt;/a&gt; on DEV. I HIGHLY recommend his writing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://dev.to/maxwell_dev/the-web-accessibility-introduction-i-wish-i-had-4ope"&gt;The Web Accessibility Introduction I wish I had&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://dev.to/maxwell_dev/comebacks-for-five-wrong-arguments-against-accessibility-5g5j"&gt;Comebacks for Five (Wrong) Arguments Against Accessibility&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Neat Videos 📹:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=HtTyRajRuyY&amp;amp;list=PLNYkxOF6rcICWx0C9LVWWVqvHlYJyqw7g"&gt;A11y cast series on Google Chrome developers channel&lt;/a&gt; - Short, easy to digest videos around different web accessibility practices.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.youtube.com/watch?v=rsglR8Y26jU"&gt;How Blind People Use Computers&lt;/a&gt; - A blind person demos how he navigates Reddit using a screen reader. Extremely insightful since if you aren't familiar with screen readers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Podcasts 🎧:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.npr.org/2020/07/27/895896462/a-d-a-now"&gt;Throughline Episode: ADA Now!&lt;/a&gt; - Not specific to the web but extremely valuable. Discusses history of A.D.A, how disability has come to be seen as a civil rights issue. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.codenewbie.org/podcast/how-to-think-about-accessibility-and-empowerment"&gt;CodeNewbies Episode: How to think about accessibility and empowerment&lt;/a&gt; - how tech can empower people of different backgrounds, how BBC integrates accessibility &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.codenewbie.org/podcast/accessibility"&gt;CodeNewbies Episode: Accessibility&lt;/a&gt; - Issues of accessibility and how we can remove invisible barriers&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Guides / References :
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://www.w3.org/WAI/standards-guidelines/wcag/"&gt;Web Content Accessibility Guidelines&lt;/a&gt; - Guidelines to follow&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Reading through guides alone can be confusing!&lt;br&gt;
I’ve found that it can helpful to inspect other websites known to do a11y well (&lt;a href="https://www.bbc.com"&gt;BBC&lt;/a&gt;, &lt;a href="https://www.reddit.com/"&gt;Reddit&lt;/a&gt;) &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you know of any other websites known to do accessibility well, let me know!&lt;/p&gt;

&lt;h2&gt;
  
  
  Accessibility Tooling
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://developers.google.com/web/tools/lighthouse"&gt;Google Lighthouse Test&lt;/a&gt;: if you use Google chrome, this should be available in your Developer tools tab. You can run this on any web page and generate a report on accessibility which tells you what can be improved.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.deque.com/axe/"&gt;Axe Chrome Extension&lt;/a&gt;: Somewhat similar to Lighthouse, but more light-weight. &lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;The idea that anyone should be able to access the web is fundamental to inception of the web. &lt;/p&gt;

&lt;p&gt;In fact, here's a quote from Tim Berners-Lee, the creator of the world wide web: &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The power of the web is in its universality. Access by everyone regardless of disability is an essential aspect. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By not taking time to learn or even think about accessibility, we as developers are likely creating invisible barriers with code. There's an abundance of tools and resources out there to help create a universally accessible experience on the web. It's never too late to start learning.&lt;/p&gt;




&lt;p&gt;Thanks for reading! Are there any resources you've found helpful or tools you've enjoyed using? Please share down below! &lt;/p&gt;

</description>
      <category>a11y</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Top 4 Advice to anyone experiencing self-doubt early in their career</title>
      <dc:creator>Kate (she/her)</dc:creator>
      <pubDate>Mon, 14 Sep 2020 00:43:42 +0000</pubDate>
      <link>https://forem.com/kateh/advice-to-my-past-self-and-anyone-starting-their-career-1fmd</link>
      <guid>https://forem.com/kateh/advice-to-my-past-self-and-anyone-starting-their-career-1fmd</guid>
      <description>&lt;p&gt;&lt;em&gt;"Everyone else knows so much more than I do."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"What value do I bring to the team?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Am I enough?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Do I belong?"&lt;/em&gt;&lt;/p&gt;




&lt;p&gt;These are all thoughts that have pervaded my mind at one point or another. These feelings of doubt, of not knowing enough, of being an &lt;em&gt;imposter&lt;/em&gt;, are extremely prevalent amongst those starting out in tech— especially amongst those who are underrepresented or come from non-traditional backgrounds. &lt;/p&gt;

&lt;p&gt;Personally, I minored in computer science, but even throughout my computer science courses, I've had a creeping feeling that I didn't quite belong or "fit the mold" of a software engineer, whatever that meant!&lt;/p&gt;

&lt;p&gt;I am now a little over two years into my career as a software engineer. Recently, I've had a strange realization that much of the self-doubting thoughts I held when I was first starting out has faded away. Not to say I never experience them, but in these past two years, I've grown more confident, learned a lot, and changed in ways that I can't fully put into words.&lt;/p&gt;

&lt;p&gt;If I could go back in time, here are some things I would have told myself two years ago. I hope this is helpful for anyone starting a new career in software engineering!&lt;/p&gt;

&lt;h2&gt;
  
  
  You belong.
&lt;/h2&gt;

&lt;p&gt;You may have a preconceived notion of what a software engineer looks like. You may feel like you don't belong in tech because you're &lt;em&gt;xyz&lt;/em&gt;. Let go of those notions. The field of software engineering is beyond what you've see portrayed on media or the confines of your classroom.&lt;/p&gt;

&lt;p&gt;There's no doubt that the field of tech, and software engineering in particular, is lacking in diversity. But that is in no way any indication of how the field should be.&lt;/p&gt;

&lt;p&gt;From those who have been coding since age 5 to those who wrote their first line of code at age 30, you're going to meet extremely bright software engineers from every walk of life. You'll find that every individual has an immensely valuable and unique perspective to offer, including yourself!&lt;/p&gt;

&lt;h2&gt;
  
  
  No one expects you to know everything
&lt;/h2&gt;

&lt;p&gt;As you start your new role, you may be flabbergasted by how much you don't know. You may compare yourself to your more experienced coworkers. In fact, you may put them on a pedestal and think, "Damn. They're so smart. How am I ever going to be like them?"&lt;/p&gt;

&lt;p&gt;But the truth is, this feeling you have of not knowing anything is extremely normal when you're starting out. You're never going to know everything and you're &lt;strong&gt;definitely&lt;/strong&gt; going to make a lot of mistakes. In fact, you'll realize that everyone makes mistakes. No one knows everything — not even the most senior member of your team. Learning to deal with ambiguity is a huge part of software engineering.&lt;/p&gt;

&lt;p&gt;At the very least, as you become more familiar with the codebase and technologies you're using, that feeling of "Ah! I don't know understand anything!" will go away. You will start to develop your own opinions and thoughts around what's good and what's not.  Discussions around the codebase that didn't make sense to you in the beginning will start to click. You will find your voice. &lt;/p&gt;

&lt;h2&gt;
  
  
  Keep expanding your world outside of what you see at work.
&lt;/h2&gt;

&lt;p&gt;Production-level software development is an entirely different beast from personal or class projects. When you're new, you may work hard to "catch up". Learning a new technology working in a new team, and making sense of an entirely new codebase can be mentally exhausting. You may pass out after work and not want to go anywhere near a computer screen. You might feel guilty and think, &lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Am I doing enough? Should I be coding outside of work?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;That answer is going to vary from person to person. Just remember that there are various ways to learn, grow, and expand your knowledge within software engineering beyond online tutorials and books. This is something I wish I had known sooner.&lt;/p&gt;

&lt;p&gt;I've always love listening to podcasts. It never occurred to me until recently to listen to software engineering related podcasts. I've been amazed at the abundance of amazing content out there whether it be discussing a particular technology, career development, soft skills, etc.&lt;/p&gt;

&lt;p&gt;In addition, there are meetups and organizations devoted to various technologies or causes within tech. You'll no doubt find a community that you identify with. &lt;/p&gt;

&lt;p&gt;The feelings you experience, the career questions you have, and the technical challenges your team face are likely not unique. Finding opportunities to learn from others outside of work can give you new ideas to share with your teammates, bring you fresh perspectives, and also deepen your sense of belonging in the developer community. &lt;/p&gt;

&lt;h2&gt;
  
  
  What you want from your work may change, and thats completely okay.
&lt;/h2&gt;

&lt;p&gt;When I was a college student, I remember not knowing at all what I wanted to do. I hustled away at career fairs mostly terrified at the thought of not having a job lined up. At the time, what I prioritized most was financial stability. I didn't know what I wanted from my career. I grew up with the idea that work was a means to making a living so finding fulfillment through work was not anything I had thought about.&lt;/p&gt;

&lt;p&gt;However, when I started my first job, I quickly realized that something didn't feel right. The feeling of discontent I felt propelled me to think more about what I actually wanted. I ended up finding a new role at a smaller startup whose mission I identified closely with. That was in no doubt, one of the best career moves I've ever made!&lt;/p&gt;

&lt;p&gt;If something doesn't quite feel right about work, take note of it but don't freak out. Remember, it takes time to figure out what you want.&lt;/p&gt;

&lt;h2&gt;
  
  
  To wrap it up
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;You belong. &lt;/li&gt;
&lt;li&gt;No one expects you to know everything&lt;/li&gt;
&lt;li&gt;Keep expanding your world outside of what you see at work.&lt;/li&gt;
&lt;li&gt;What you want from your work may change, and thats completely okay. &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There can be a lot of ambiguity and self-doubting as you navigate a new codebase, technology, and team. Understand that these feelings of self-doubt you experience are normal, and may gradually fade away. Continue learning and trust that you're growing. :-) &lt;/p&gt;

&lt;p&gt;I hope this is helpful to anyone who is early in their career!&lt;/p&gt;




&lt;p&gt;Thank you for reading until the end! I'd love to hear any thoughts you have down below.&lt;/p&gt;

</description>
      <category>career</category>
      <category>beginners</category>
      <category>motivation</category>
      <category>mentalhealth</category>
    </item>
  </channel>
</rss>
