<?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>DEV Community: Jonathan Grabowski</title>
    <description>The latest articles on DEV Community by Jonathan Grabowski (@jongrabowski).</description>
    <link>https://dev.to/jongrabowski</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%2F1108235%2Fef4b946e-d807-4cfc-88ee-dede00452ab5.jpeg</url>
      <title>DEV Community: Jonathan Grabowski</title>
      <link>https://dev.to/jongrabowski</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jongrabowski"/>
    <language>en</language>
    <item>
      <title>Python Classes: What They Are And Why They're Great!</title>
      <dc:creator>Jonathan Grabowski</dc:creator>
      <pubDate>Thu, 10 Aug 2023 05:44:41 +0000</pubDate>
      <link>https://dev.to/jongrabowski/python-classes-what-they-are-and-why-theyre-great-12hl</link>
      <guid>https://dev.to/jongrabowski/python-classes-what-they-are-and-why-theyre-great-12hl</guid>
      <description>&lt;p&gt;Before I enrolled in the software engineering bootcamp I'm currently attending, I took an Intro to Python course on Codecademy.com. I wanted to get a feel for what coding was actually like before committing to a bootcamp and a few of my friends recommended Python as a good jumping off point. They were right, Python was fantastic language to begin with! However, towards the end of the intro coarse the idea of classes was introduced and I struggled to wrap my head around. It was hard for me to conceptualize at first what they could be used for but after gaining more experience and seeing them in action and I started to understand their power.   &lt;/p&gt;

&lt;h2&gt;
  
  
  So, What Are Classes in Python?
&lt;/h2&gt;

&lt;p&gt;Classes are a fundamental concept in object-oriented programming (OOP) and play a crucial role in creating organized, reusable, and maintainable code. They are blueprints for creating objects. Classes allow you to define a new data type, encapsulating both data (attributes) and functions (methods) that operate on the data. This concept is known as encapsulation, which helps to organize and manage code more effectively.&lt;/p&gt;

&lt;p&gt;Picture this: You're in a virtual pet shop, and each pet has its own set of features and characteristics. All the pets have a name, age, and species they belong to, but these will be different depending on the pet. We can set up a class and now we'll be able to easily access information about each of them! Let's set up a simple class for our virtual pets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class VirtualPet:
    def __init__(self, name, age, species):
        self.name = name  # Attribute
        self.age = age  # Attribute
        self.species = species  # Attribute

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

&lt;/div&gt;



&lt;p&gt;Attributes are variables that store data related to the class. They represent the characteristics of an object. We'll be able to access the name, age, and species of each pet by using these attributes. Now that we have our class set up, let's create some instances of Pet to represent some of our virtual pets:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;roboDog1 = VirtualPet('Fido', 10, 'dog')
eKitty1 = VirtualPet('Potato, 7, 'cat')

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

&lt;/div&gt;



&lt;p&gt;Now if we want to see the name of our first roboDog or the age of our first eKitty we can use our attribute!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(roboDog1.name)
# Output: Fido

print(eKitty1.age)
# Output: 7

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

&lt;/div&gt;



&lt;p&gt;Attributes are great for accessing data about an object, but what if we wanted some more functionality from our class. That's where methods come in. Methods are functions defined within a class that can perform actions or computations related to the class. They define the behavior of the objects created from the class. Continuing with our VirtualPet example, methods could include feed() and sleep(). Let's add these methods to our VirtualPet class.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class VirtualPet:
    def __init__(self, name, age, species):
        self.name = name        # Attribute
        self.age = age          # Attribute
        self.species = species  # Attribute

    def sleep(self):            # Method
        return f"{self.name} the {self.species} is taking a nap."

    def eat(self, food):       # Method
        return f"{self.name} is eating {food}, yum!"

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

&lt;/div&gt;



&lt;p&gt;Now we can have our pets carry out these activities!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;print(eKitty1.sleep())
# Output: Potato the cat is taking a nap.

print(roboDog1.feed('CyberChow'))
# Output: Fido is eating CyberChow, yum!

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

&lt;/div&gt;



&lt;h2&gt;
  
  
  Benefits of Python Classes
&lt;/h2&gt;

&lt;p&gt;Now, let's delve into why Python classes are so useful:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Modularity and Reusability&lt;/strong&gt;: Classes allow you to break down complex systems into smaller, manageable modules. These modules can be reused across different projects, saving development time and effort.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Organized Code&lt;/strong&gt;: By encapsulating data and methods within classes, you can organize your code more logically. This makes it easier to understand, maintain, and debug your codebase.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Code Extensibility&lt;/strong&gt;: Inheritance and polymorphism enable you to create new classes that inherit and extend the behavior of existing classes. This promotes code extensibility without modifying the original class.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Collaboration&lt;/strong&gt;: Classes enable multiple developers to work on different components of a project simultaneously, as long as they adhere to the defined class interfaces.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Improved Testing&lt;/strong&gt;: Classes allow you to write unit tests for individual components, making it easier to identify and fix issues during the development process.&lt;/p&gt;

&lt;p&gt;Python classes are a powerful tool in object-oriented programming that facilitate the creation of well-organized, modular, and reusable code. They enable you to encapsulate data and behavior, promote code extensibility, and improve collaboration among developers. Incorporating classes into your programming arsenal can lead to more efficient and maintainable software development!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Python Default Values and Mutable Data Types, A Headache Waiting to Happen</title>
      <dc:creator>Jonathan Grabowski</dc:creator>
      <pubDate>Thu, 27 Jul 2023 16:07:07 +0000</pubDate>
      <link>https://dev.to/jongrabowski/python-default-values-and-mutable-data-types-a-headache-waiting-to-happen-4lcm</link>
      <guid>https://dev.to/jongrabowski/python-default-values-and-mutable-data-types-a-headache-waiting-to-happen-4lcm</guid>
      <description>&lt;h2&gt;
  
  
  What Are Default Values
&lt;/h2&gt;

&lt;p&gt;In Python, functions can have default values for their arguments. This can be VERY useful if you want to make one or more of your arguments optional. For example, say we had a function that printed a holiday greeting to our friends! We could set up our function to expect a name for our friend but give it a default value in case one isn’t provided:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def holiday_greeting(greeting, name = "friend"):
    print(f"{greeting}, {name}!")


holiday_greeting("Happy Thanksgiving", "Dan")
# output --&amp;gt; Happy Thanksgiving, Dan!


holiday_greeting("Merry Christmas")
# output --&amp;gt; Merry Christmas, friend!
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The first time we called our &lt;strong&gt;holiday_greating()&lt;/strong&gt; function, we passed it a string of “Dan” as a value to our &lt;strong&gt;name&lt;/strong&gt; variable. When our function is called the second time, no value is passed for &lt;strong&gt;name&lt;/strong&gt; so our default value of “friend” is used. Setting default values can come in pretty handy when working in python, but there is something you should know that may prevent you from running into the debugging nightmare I found myself in. When deciding to set a default value make sure to use an immutable data type, such as &lt;strong&gt;int, float, decimal, bool, string, or tuple&lt;/strong&gt;. If you try to use a mutable data type, such as a &lt;strong&gt;list, dictionary, or a set&lt;/strong&gt;, you may run into some unexpected behavior that could prove frustrating and time consuming to troubleshoot! Let’s explore an example of using an empty list as a default value and see what happens.  &lt;/p&gt;

&lt;h2&gt;
  
  
  MUTABLE DEFAULT VALUES
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def function1(num, num_list = []):
    num_list.append(num)          
    print(num_list)                
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the function we defined above two arguments are expected. The first, &lt;strong&gt;num&lt;/strong&gt;, is required while the second argument, &lt;strong&gt;num_list&lt;/strong&gt;, is optional and expects a list. The function simply takes the number passed in as &lt;strong&gt;num&lt;/strong&gt; and appends it to the list pass in as &lt;strong&gt;num_list&lt;/strong&gt;. Let’s look at an example of our function being called twice with no second argument passed in:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function1(1)
# [1] &amp;lt;--- Expected Output
# [1] &amp;lt;--- Actual Output


function1(2)
# [2] &amp;lt;--- Expected Output
# [1, 2] &amp;lt;--- Actual Output
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Below each function you can see what I expected the output to be versus what the actual output was. The first time the function got called it acted exactly as I expected it to, but when the function got called a second time something odd happened! There were two items, [1, 2], in my list when I expected to see a list with just the one number, 2,  I passed in as an argument. The second number in the list is the number I passed into the function, but where did that first number come from? Upon closer inspection it seems like it’s the number I passed in the first time we called our function. How can that be? When I called &lt;strong&gt;function1()&lt;/strong&gt; the second time without a second argument it should have defaulted to an empty list to append our number to. Why is our first number still in the list?&lt;/p&gt;

&lt;p&gt;The answer lies in the way in which Python evaluates default arguments. Python’s default arguments are only evaluated &lt;em&gt;&lt;strong&gt;once&lt;/strong&gt;&lt;/em&gt; when the function is first defined, not every time the function is called. Since every call to our function points to the same value that was evaluated once when the function was defined, if our default value is a mutable type and we mutate it, it does exactly that! When we defined our function, the default value for &lt;strong&gt;num_list&lt;/strong&gt; was evaluated and set to an empty list. The first time we called the function, we appended a number to that empty list and mutated it. When we called our function the second time, our number was then appended to the list we had just mutated and now includes the number from our first call! This took me FOREVER to debug!&lt;/p&gt;

&lt;p&gt;So now that we know what happens when we set a mutable data type as a default value, how can we get around this issue?&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Can Do Instead of Using Mutable Default Values
&lt;/h2&gt;

&lt;p&gt;If you find yourself in a situation where you would like a function or class to have the option of passing in a mutable data type as an argument there is an easy solution to avoid the problem I ran into. Instead of setting the default value to a mutable type, set it equal to &lt;strong&gt;None&lt;/strong&gt; and then put a conditional inside of your function that will create a new empty list if no list is passed in. Let’s see what this might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def function2(num, num_list = None):
    if num_list == None:
        num_list = []
    num_list.append(num)
    print(num_list)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we see that if no second argument is passed in for &lt;strong&gt;num_list&lt;/strong&gt; then the value defaults to  &lt;strong&gt;None&lt;/strong&gt;. We then check to see if &lt;strong&gt;num_list == None&lt;/strong&gt; and if it does we create a new empty list right there and set that equal to &lt;strong&gt;num_list&lt;/strong&gt;. From here we can append our number to the list and it should function as intended!&lt;/p&gt;

&lt;p&gt;While Python encourages writing clean and expressive code, the use of mutable defaults can lead to hidden bugs and unpredictable behavior. Understanding the concept of shared mutable objects is crucial for writing robust and maintainable code. By following best practices and opting for immutable defaults, you can avoid the perils of mutable defaults and ensure the reliability of your Python code. Hopefully this blog can save you from a potentially frustrating debugging issue!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>python</category>
      <category>programming</category>
      <category>newbie</category>
    </item>
    <item>
      <title>Functions, Functions Everywhere!</title>
      <dc:creator>Jonathan Grabowski</dc:creator>
      <pubDate>Mon, 03 Jul 2023 02:01:33 +0000</pubDate>
      <link>https://dev.to/jongrabowski/functions-functions-everywhere-49ij</link>
      <guid>https://dev.to/jongrabowski/functions-functions-everywhere-49ij</guid>
      <description>&lt;p&gt;I’d like to discuss the importance and power of utilizing functions throughout your code. In the world of programming, functions are the building blocks that enable developers to create efficient, organized, and reusable code. By encapsulating specific pieces of functionality into self-contained units, functions bring modularity and flexibility to our codebase. When I first began learning JavaScript I found myself hesitant to wrap much of my code into functions, thinking it was unnecessary and believing they should be reserved for larger tasks I wanted to accomplish. As I continued to learn and as the code I was writing was becoming more complex I started to realize how helpful and efficient functions really were, not only for myself but also for others reading my code. Let me paint you an example…&lt;/p&gt;

&lt;p&gt;Early in my schooling I was doing a practice lab where I had to render a bunch of similar items onto cards. My data was organized into an array of objects, each object representing an individual item’s information (item’s name, item’s description, item’s image, etc.). I used the .forEach method to iterate through my array and create the necessary DOM elements for each item’s information and then appended those elements to an item card. My code looked something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;arrayOfItems.forEach(item =&amp;gt; {
    const itemCard = document.createElement('div');
    itemCard.className = 'item-card'
    const itemName = document.createElement('h2');
    itemName.innerText = item.name;
    const itemDesc = document.createElement('p');
    itemDesc.innerText = item.description;
    const itemImg = document.createElement('img');
    itemImg.src = item.image;
    itemImg.alt = item.name;
    itemCard.append(itemName, itemDesc, itemImg);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I created and set all my DOM elements for each card right within my .forEach method. This was completely functional but later on in the lab I was asked to render a new item card for a new item that was submitted through a form. For a moment I thought I would have to re-write the same code I used early but that’s when it dawned on me. If my previous code to create the item card was in a function I could re-use it easily and quickly wherever I wanted! So I refactored my code to look like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function createItemCard(item) {
    const itemCard = document.createElement('div');
    itemCard.className = 'item-card'
    const itemName = document.createElement('h2');
    itemName.innerText = item.name;
    const itemDesc = document.createElement('p');
    itemDesc.innerText = item.description;
    const itemImg = document.createElement('img');
    itemImg.src = item.image;
    itemImg.alt = item.name;
    itemCard.append(itemName, itemDesc, itemImg);
};

arrayOfItems.forEach(item =&amp;gt; {
    createItemCard(item)
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now I had a function that I could pass my new item into!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;createItemCard(newItem);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not only did this save me the time of not having to re-write my code, but I also realized how much this helped with my code’s readability. In the first example above, it isn’t immediately clear what I’m doing to each item in the array I’m iterating through. Now that we have a function with a descriptive name, it’s much easier to know exactly what we’re doing with our items. We’re creating item cards!&lt;/p&gt;

&lt;p&gt;Wrapping code blocks in functions is a great way to make your code more modular, you never know when you may need to use that same process again later in your program. You don’t need big code blocks to make functions practical though. Sometimes having a function for a small task can prove to be very helpful, especially if you find yourself doing that task over and over again.&lt;/p&gt;

&lt;p&gt;In our examples above, we used document.createElement four times in just that one createItemCard function. We may have many other instances throughout our code where we need to create elements as well. Typing document.createElement repeatedly can become very tedious. What if we wrapped that one action into a function?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function ce(element) {
    return document.createElement(element);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now we have a simple function we can call whenever we need to create a new DOM element! Need a new &amp;lt;p&amp;gt; element?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const newParagraph = ce('p')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;How about a new &amp;lt;img&amp;gt; element?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const newImage = ce('img')
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s refactor our createItemCard function from earlier to take advantage of our new function to create DOM elements!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function createItemCard(item) {
    const itemCard = ce('div');
    itemCard.className = 'item-card'
    const itemName = ce('h2');
    itemName.innerText = item.name;
    const itemDesc = ce('p');
    itemDesc.innerText = item.description;
    const itemImg = ce('img');
    itemImg.src = item.image;
    itemImg.alt = item.name;
    itemCard.append(itemName, itemDesc, itemImg);
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Much cleaner and we saved ourselves from having to type document.createElement over and over again! Functions serve as the backbone of modular programming, enabling us to write code that is clean, readable, and reusable. By breaking down our code into functions, we achieve better organization, enhanced readability, and improved maintainability. Make regular use of functions to improve your coding experience! &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>learning</category>
      <category>javascript</category>
    </item>
    <item>
      <title>The Power of Console.log()</title>
      <dc:creator>Jonathan Grabowski</dc:creator>
      <pubDate>Mon, 26 Jun 2023 01:28:33 +0000</pubDate>
      <link>https://dev.to/jongrabowski/the-power-of-consolelog-2aog</link>
      <guid>https://dev.to/jongrabowski/the-power-of-consolelog-2aog</guid>
      <description>&lt;p&gt;Debugging is an essential skill for every developer, new or experienced, and JavaScript provides a powerful tool for this purpose: the console.log function. Let’s first touch on what console.log actually is. As its name implies, console.log is a built-in JavaScript function that allows you to log information to the console. The console is a developer tool available in most web browsers, which provides a space for outputting messages, errors, and other useful information during runtime. By logging relevant data using console.log, you can inspect and understand what's happening in your code at different points of execution.  &lt;/p&gt;

&lt;p&gt;For example, let’s say you had some data stored in variables:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const name = “Homer”
const age = 39
const address = “742 Evergreen Terrace”

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

&lt;/div&gt;



&lt;p&gt;If we wanted to see what information our variables held we could console.log them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;console.log(name)
// Would output Homer to the console.

console.log(age)
// Would output 39 to the console.

console.log(address)
// Would output 742 Evergreen Terrace to the console.

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

&lt;/div&gt;



&lt;p&gt;This can be very powerful, especially when our code starts getting more complex and variables are being passed around and operated on. When I first started learning JavaScript I found myself utilizing the console.log very sparingly, only really using it when my code was broken and I needed to track down the issue. This would often lead to a frustrating debugging process, especially if I had written a lot of new code since realizing there was an issue. A major breakthrough for me came when I began using console.log more &lt;strong&gt;in the process&lt;/strong&gt; of writing my code rather than waiting until something broke. For example, let’s say I wanted to write a function to handle the clicking of a like button. First I would check to make sure I attached my event listener to the correct button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleLikeButton () {
    console.log(“Like button was clicked!’);
}

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

&lt;/div&gt;



&lt;p&gt;If I click the like button and the message “Like button was clicked!” is logged to the console, I know that I attached my event listener to the correct button and it is firing off my handleLikeButton function as intended. Great! Now I can start building the function out. First I will need to grab the DOM element where my likes are displayed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleLikeButton () {
    const likeElement = document.getElementByID(“likes”);
}

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

&lt;/div&gt;



&lt;p&gt;Did I grab the correct element? Let’s console.log it and find out!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleLikeButton () {
    const likeElement = document.getElementByID(“likes”);
    console.log(likeElement);
}

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

&lt;/div&gt;



&lt;p&gt;If the correct DOM node now shows up in the console when the button is clicked I know I’m on the right track! Now I have to increment the variable I’m storing my like count in. For the sake of this example, we’ll call it likeCount:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleLikeButton () {
    const likeElement = document.getElementByID(“likes”);
    likeCount++;
}

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

&lt;/div&gt;



&lt;p&gt;Did that actually increment my likeCount by 1? Was my syntax correct? I know how to find out!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleLikeButton () {
    const likeElement = document.getElementByID(“likes”);
    likeCount++;
    console.log(likeCount);
}

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

&lt;/div&gt;



&lt;p&gt;Now when I click my like button a few times I should see the number incrementing in my console with each click. If not, I know that my syntax may be wrong or perhaps I tried incrementing the wrong variable. Either way, I know that there is an issue here before I try moving on to the next step! If my console is increasing the likeCount as expected, I know that I’m now good to proceed and set the inner text of my likeElement to our updated variable:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;function handleLikeButton () {
    const likeElement = document.getElementByID(“likes”);
    likeCount++;
    likeElement.innerText = likeCount
}

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

&lt;/div&gt;



&lt;p&gt;Whether you’re building out a function, fetching data from an API, or trying to access certain elements of an array or object, console.log can help you along the way! It’s a great way of keeping track of your data and finding potential issues before they are buried in a pile of code and harder to root out. Wield the power of console.log() to debug as you write your code and save yourself from some potential future headaches. I know I will!&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>beginners</category>
      <category>productivity</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Welcome to my Blog!</title>
      <dc:creator>Jonathan Grabowski</dc:creator>
      <pubDate>Mon, 26 Jun 2023 01:16:08 +0000</pubDate>
      <link>https://dev.to/jongrabowski/welcome-to-my-blog-5d4n</link>
      <guid>https://dev.to/jongrabowski/welcome-to-my-blog-5d4n</guid>
      <description>&lt;p&gt;Hello and welcome to my inaugural blog post! I’m going to be honest, I’ve never really had a great relationship with writing and certainly never thought I would start my own blog. I really enjoy reading and love to appreciate the written word of others, but I’ve always struggled to find my own voice with it. Most attempts result in hours of staring at the same few sentences, mulling over phrasing and questioning which direction to go in (much like I’m currently doing, lol). I’m hoping this blog can serve as a kind of training ground for me to practice my writing while simultaneously providing an outlet to discuss something that I’ve recently taken a huge interest in; software development and tech!&lt;/p&gt;

&lt;p&gt;Full disclosure, I’m a total coding newbie. I’ve just finished my fourth week of a software engineering bootcamp and I had very minimal exposure to coding before starting the program. Prior to making this career shift I was working, very unhappily, as an accountant. I’m not here to speak badly of accounting as a profession, but it was certainly not for me. I felt that my professional routine had become too cyclical. Similar reports, filings, and data entry month after month. I found myself becoming very disengaged from my work and wanted to find something that sparked my interest more intensely. After speaking with some friends who had transitioned into the tech industry later in life, I felt that software engineering might be a great fit. The work sounded thought provoking and deeply engaging, having to apply logical methods for solving problems or building new features. I took a basic Intro to Python course on Codecademy and I was hooked!        &lt;/p&gt;

&lt;p&gt;After deciding that this was to be my new path, I enrolled in the Flatiron School software engineering bootcamp. To say that starting this program felt like diving into the deep end would be an absolute understatement. The pace at which we’re learning is intense! Luckily, I have some really great instructors and classmates who have made this seemingly impossible amount of information digestible. While the feeling of being overwhelmed by information can be pretty uncomfortable, those moments of clarity when a new idea or concept finally clicks are so rewarding and exciting! &lt;/p&gt;

&lt;p&gt;That’s what I’d like to express and share with this blog, the conceptual breakthroughs that have helped me along the way in my journey to becoming a software engineer. So far in just the first few weeks we’ve dove into HTML, CSS, JavaScript, and a bit of React. I’m honestly rather shocked at how much I’ve learned and retained in just a few weeks. In this blog I’ll attempt to chronicle some of the revelations I’ve had that have helped me along the way. Hopefully they will help you out as well! With that, my next blog post will be discussing the usefulness of my new best friend… console.log()!&lt;/p&gt;

</description>
      <category>beginners</category>
      <category>programming</category>
      <category>codenewbie</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
