Zeroes and Ones

A Bucket of Cold Water

bucket 1

Have you ever received a bucket of cold water? It might not have been very pleasant. It's an overwhelming experience that takes all of your attention, is uncomfortable, and you stand there paralyzed. Well, I had one off those days.

During our kata we tried to tackle a problem that needed promises. Promises have never been my allies, I find them confusing, and I haven't had the need to do anything with them besides consuming them after using fetch (which is much more straightforward). Since there was a Meetup regarding that very same subject, I thought it would be good to try it, well, it didn’t turn out as nicely.

I was 'driving', and my first problem was that I realized I didn't completely understand the problem. There is this quote from Einstein (attributed at least)

If I had only one hour to save the world, I would spend fifty-five minutes defining the problem, and only five minutes finding the solution.

My anxiety being in the keyboard made me try to jump right into a problem I quite didn't grasp well, whose solution relied on a technique (Promises) I wasn't confident about. Yeah, sounds like a winning formula.

So I was couple of minutes in and I just blocked out, incapable of reasoning, and making crazy and unusual syntax errors. More time that passed, it got worse. I realized how little I know, how much trail I need to walk to be competent, maybe this wasn't a really good idea after all? I finally got crushed under my own pressure.

This is Osgiliath, I choose to put LOTR images if it pleases me, is my blogThis is Osgiliath, yes is a LOTR image, it's my blog

Aftermath

When everything was over, and was back at my spot after lunch I thought that I needed to do something. I could drown in self-pity or try to learn from the fall. I reflected on my shortcomings and realized I needed to do something about it.

Firstly, I'm not writing websites on my own using just a script file and debugging and testing everything in the Chrome console. As the meme says ‘Modern problems require modern solutions. So I decided first to learn about my kata mistake, learn the problem.

I found this great article in Sitepoint about the "Anatomy of a modern JS Application". That is what I'm striving to do, so I started but learning by heart the components and processes that were involved, how the file structures worked and why. I made some fast diagrams and tried to sink in all, I will revisit this periodically until is boring to look at.

Second step, was to change habits. Although Tinitest.js served me well and introduced me into the world of Unit Testing, if I wanted to get more serious I needed something different that runned nicely in Node. I decided to use Jest.

I created and deleted multiple times Node projects, get familiar with them, the structure, adding dependencies, adding the scripts in the package.json, the .gitignore, using babel, having a dist folder where to send the code after build, code to be deployed. After a couple of times I thought, maybe I can make a shell script to automate this and I did, is here, it's probably crappy, already exists in a better, and a seasoned scripter might think is trash. I don't care (to say it politely), this one is mine, and is a learning process itself. Before relying on tools I better learn how to build them.

I realized I didn't want to forget the steps to build my projects (adding scripts, how to run them, etc) so I made a file as a gist with that info, and my mentor told me I could use curl to grab that info and copy it into my generated repo. So I did.

The only way of getting away with a cheesy -yet necessary- picture, is to acknowledge it yourselfThe only way of getting away with a cheesy -yet necessary- picture, is to acknowledge it yourself

Day after

I asked if I could 'drive' again the next day, with a clearer mind, and trying to tackle a problem I could understand. My social anxiety of coding live and being judge will not go away by hidding, but by trying to confront it (although in steps, not to get blocked again). I did so today, and even though I still got nervous and made some stupid mistakes (forgot to initialize the i variable in a for loop for ex, yeah, that happend), I think it was a step forward in the right direction.

Will my time as an apprentice be enough for me to be competent and be able to actually bring something to the table in the office? In all honesty, I don't know, but I do hope so. The thing is, that is beyond my power, outcomes can’t always be controlled, but I can control (at some degree at least) my actions, I can make the best I can with what I have and just keep grinding.

Bucket of cold water is uncomfortable, and overwhelming. But after the shock it can become fuel, can awaken you. I decide to take like that.

Developed by Cristobal Heiss