I have a very disorganized 148 page google doc of notes I’ve taken from all the online resources I’ve used for HTML, CSS, JS, and ethereum. They don’t look pretty. In fact, they’re messier than my living room. One day I’ll get around to organizing and cleaning them up, but that might be when I don’t need them any more. For now the Command F key, keeps everything where it needs to be. But just because my coding notes are a mess, doesn’t mean my code should be a mess. In fact, I wish I would’ve taken the time to get my code ready to date as I was doing tutorials. Here’s what that means:
Write clean code, make friends
My code is sometimes disastrous. I’m not sure what I’m doing, I’m just sorting through that 148 page document until I find some explanation that I think applies to what I’m trying to do. But leaving my code a mess isn’t doing me any favors. In fact, it inhibits my growth as a coder. A couple of months ago, I was working on the Freecodecamp Twitch API. It went beyond my abilities, so I gave up. Fast forward to a couple of weeks ago when I tried to go back to my codepen to figure it out. (Please do not look at my codepen, I’m begging you.) I couldn’t even understand what I was trying to do. Imagine if I needed to ask a developer for help or if I were working on a project that I had to hand off. Dirty code isn’t going to make you friends.
Leave some love notes
Another good coding practice is to comment out your code. For newbs who want to know more about commenting out code, this is a good resource. Even with my dirty code, I would have had some idea of what I was trying to do if there were comments. I would love to go back through projects I’ve worked on and see what I was thinking. Not only does this help with communication among developers, but for newbie coders like me, it can help us to track our progress.
Put some lipstick on it
You should always polish your work. That means taking some time to go back and clean it up, test it out, and even proofread the copy. Last week, I posted a blog that I was really excited about. In the preview mode, everything looked good. Apparently, that was not the case, and I had screwed up the link formatting–still not sure how I overlooked that. I thought I had my lipstick on properly, but really I was wearing it on my teeth. Your code should be readable, in good form, and produce the desired results on the screen.
I know that my code still is messy, but building habits starts early. One of my goals is to work on open source projects. To do that right, I have to be able to work with other developers and to collaborate in ways that other people can understand. Because this isn’t an objective, teachable task, it’s only mentioned in most of the online resources I’ve used. But for my fellow newbie coders out there, let’s work on doing this together.