There is a bittersweet lesson to be learned at any point in a developer's career. That is, we will always be learning no matter how advanced our knowledge is in some areas even if that means revisiting the basics.
I was asked three very important questions that I should have known the answers to. They are the following:
What is the difference between a Div and Span within HTML?
What is the difference between the Grid and Flexbox within CSS?
What is the difference between Classes and IDs in HTML?
Upon reflecting on my experience, I have blindly used these elements without ever asking myself what the technical purpose of them was. I suppose I allowed myself to default on the idea that they were simply used for developer readability. This was not the case. Divs are a block level element used to wrap sections of a document while a Span is an inline level element used to wrap small portions of content on a webpage.
This was eye-opening to me since the use at face value for both Grid and Flexbox seemed only slightly different from each other. While this is true, the reason for why and how we use them wasn't clear to me. In my research, I found that the Flexbox Layout is designed for layout in one dimension -- either a row or column. However, the Grid Layout serves as an extended use. The Grid is designed for a layout of two dimensions -- rows AND columns at the exact same time. There are certain percs that apply to both layout types such as
fr for fractions, but for the sake of not detailing onto a sub-topic, we will save them for another blog post.
This one really made me feel ashamed of myself, but I embraced this gap in knowledge as an opportunity to grow and be a better developer.
I, personally, have used classes way more than I've ever used IDs. It came back down to the fact that I didn't understand their technical uses despite functioning in the exact same way within CSS.
Classes are meant to identify more than one element whereas IDs do not. IDs are only meant to identify a single element. Selectors are pre-built within HTML and can be used for specific purposes such as the
<p> tag, but classes and IDs are mainly used to select uniquely used elements on a webpage (with classes able to be used multiple times on a single page). We are even able to use a class and ID at the same time for one element, but the restriction is that ID can only have one unique value while the class can contain multiple.
In my case of failure to address these technical questions, I found that I faced two options: Either I was going to allow it to defeat me, or I was going to grow from these gaps. Being a software engineer has a funny way of bringing you down to earth and reminding you that there is much to learn. My biggest take from this experience was that it never hurts to revisit your roots and sharpen your basic skills. I feel that no matter what happens from here on out, I will remain a better developer than I was yesterday because of this experience. I am thankful for what I've learned, and I am excited for my next challenges ahead!