Programming is like being in a relationship, especially when you’re the boyfriend trying to do something your own way, just to hear the line, “That’s not what I meant”. In the beginning I wrote code not thinking about the readability or the structure. I thought functionality was the only important thing when it comes to programming. But like a boyfriend who handles things his own way, just typing letters and symbols without format isn’t going to get you far. Just because something is working doesn’t mean it’s working well. I started to realize the importance of writing neat code when I had to debug an old project. Since my code was all over the place, it took me six hours just to find that the reason why my code was crashing was due to a missing semicolon. I’ll be honest I was still messy when the semester started, You’d find a parenthesis or brackets that is placed 5 lines away from the function. But like every relationship, there’s a breaking point. When your girlfriend had enough of your sloppy effort, you’ll be met with instructions on how to handle things next time( at least I hope). And this is what happened to me. In my case, I am taking ICS 212 where the instructor has a strict coding standard that we had to follow or we’d lose almost 50% of our homework grade. Adding to that, I was taking this class, ICS 314 where ESlint has to be passed in almost every WOD and homework.
As the semester progressed came the changes in style. Just like how you mature in a relationship once you start following what your lady wants, you develop methods and patterns on how to tackle specific situations. Think of styling errors like love advice, they are meant to help you but you’re not forced to follow them. For example, think of ESlint as your girlfriend always there to point out what you’re doing wrong. You’re practically correct, just emotionally wrong. When my lines exceed the limit of characters, it sends me errors. When I cross the line I’m not supposed to cross, it asks for space. But after enough arguments or when you’re tired of being yelled at, you realize that you should listen to your girlfriend and see if that changes anything. In similar matters I started to follow the coding format ESlint wanted me to write. And life has been a lot peaceful since then.
In just a semester I learned how to place my curly brackets and parentheses where I won’t lose them. I always knew which was partnered with what. I learned to count spaces before starting a new line. I also leave comments so future me understands what I was doing at that time. These were just a few patterns I noticed in my homework. How I wished I had the red underline ESlint threw every time I messed up in real life, but things like what your girlfriend instructions and ESlint format should be embedded in your mind. It’s a good and handy practice to have. Because when you finally code in a way that is functional and readable, it’s the same feeling as hearing, “Wow, thank you this is exactly what I had in mind.”