Complacency
You know it, I know it, we know it: that feeling.
You're in the gym, staring at those plates you've just added to the barbell. It all only comes to a couple pounds heavier than last week.
"Increase the resistance if you want to get stronger", they said - and you listened.
But there's a murmur creeping in...
- That's going to feel heavy
- It'll be uncomfortable
- Just a few pounds lighter?
- You'll do it next time, c'mon!
We're built to avoid pain and seek pleasure. Avoid discomfort and seek comfort.
Avoid "bad", chase "good" - it's engrained in us.
It only takes a moment, we falter, aaaaaand... that's it: we gave in.
Exit murmur, enter Mr. Guilt - eternal, malignant regent of Comfortzone D.C.
What happens next is, you're going to spend the following minutes, hours, possibly days, wondering what if... ?What if I had pushed through instead of caving in?
That guilt is the echoing lament of all your unrealised potential, all the "gains" you missed (don't know why, but this sounds like a good title for a rock ballad).
Why's this on Hashnode, anyway? What's this got to do with tech or code?
Well, as it turns out, I just had a glaring example of the above a couple weeks ago, which turned out to be very productive one. Lots of growth... and lots of discomfort.
Stepping out
When working through my Data Structures and Algorithms certification on Freecodecamp, I really enjoyed completing the Roman Numeral Converter project and wanted to build it as a static web page, rather than just a JavaScript file.
Nothing complex, it was just a matter of adding the HTML and CSS parts, and linking it all together... and I would have learned nothing, had I done it that way. I decided to "complicate" things.
I had Node.JS and NPM installed but never quite used them, and also wanted to see what the fuss about TailwindCSS was about, so I threw all of them in the mix - I was in for a treat!
What followed was a week of intense learning, as I kept coming across things and workings I had no clue about.
I won't go through the whole story, as it would probably be tedious, but I can list all the important bits and pieces that I took away.
Some of the things I learned
- When importing other JavaScript scripts into my main one, I'm dealing with modules and they have their own syntax (which I had to learn).
- I had to download and install all my dependencies (what I wanted to use in my project), some of which required other dependencies to be installed
- When building a simple HTML/CSS/JS static page, I only deal with one folder, which I push to my Github repo.
- Packages come with default settings, not all of which will suit you. They also come with a JSON config file that can be modified according to the framework specifications.
- I can't just include TailwindCSS in my CSS file, because it's made of plenty of classes that I won't use. I can, instead, run a script that tells it to build the final file in my dist folder and purge out all unutilised classes. This script can be set in your "package.JSON". Not running purge will result in a huge CSS file that's mostly pointless.
- More generally speaking, I learned how to use Tailwind classes in my HTML and how to modify them, if required.
- Learned to use other packages I didn't plan on using (gh-pages, autoprefixer)
- Ultimately, as long as you're using a version control system like Git to track your project, nothing is really broken. You can always revert back to a previous stage.
I had to stare at my screen several times, thinking "why does this NOT work?", before finding out about many of the things I listed - you don't know what you don't know.
You need to make mistakes, so that you can learn. And you will learn incredibly fast when you start making those mistakes and fixing them.
There would be even more things to list, but it would get too long and you would get... comfortable (see what I did there?).
I didn't spend more than 30 minutes, sometimes an hour, over the course of four or five days, with varying levels of attention due to my full-time job. That's a lot of learning for such a little time dedicated to it.
What's better is that these new bits of knowledge are now embedded in my mind and I will carry them with me in future projects. Knowledge builds up!
To conclude
Am I saying complicating things is good? Far from it, but in this case it served a specific purpose: forcing me to become acquainted with things I hadn't learned yet.
The point was not whether TailwindCSS or another technology were necessary (they weren't), but to implement them and learn to use them.
In a real-world situation, you would go with whatever option best matches your needs (or with whatever your boss or company says you're going to use), but in your personal projects, and especially if your main goal is learning you can go wild (and you probably should). Your IDE is your playground.
Will using one of these technologies in one project be enough to master them? Of course not. But you will have learned the basics, and next time you'll be able to build upon them, and expand further.
So...
...Why are you still here? Excuse me reader, I'm going to have to ask you to move along.