Let me preface this by saying — these are not textbook facts or solutions to every developer problem. This is a short list of helpful reminders for myself, and hope they can benefit others during their developer endeavor. These are concepts that have stood out to me as very crucial habits to implement in my daily studies.
While cliché, this concept continues to prove it’s worth in my everyday studies, project building, and teaching. Let me paint this picture: you start a new course, read about a new concept, watch an awesome video on a new piece of code you can not wait to implement!
Ecstatic, caffeine flowing through your veins and your favorite song playing in the background — you dive right in!
After several hours of speed reading documentation, rushing through lines of code that mean nothing to you, and copying the code “just like it is on the example!” to your surprise… the code doesn’t work!
So you take a gander at your console, and the problem is worse. Errors, warnings, and broken code. So much so, that your errors, have their own errors! It’s a nightmare!
This exact example I have found myself in a countless number of times, and it took me forever to learn the hard way. Slow down, and understand each line of code. Set up your environment, make sure everything is rendering properly. Organize your files, make sure you understand how everything is paired together. Confirm you have all of your proper packages and latest updates downloaded. These are such crucial steps that I still forget daily! We all need reminders!
Back to the main idea — Quality over quantity. It’s better to have a few functional lines of code, that you can:
- Understand conceptually
- Re-implement in a similar project
- Explain to someone else who inquires about that line of code
If you are unable to satisfy any of these three requirements — chances are, you don’t fully understand what you just typed (or copy + pasted), and need to take a step back, review the code, do a deep dive on the concepts, and make sure these ideas are cemented in your brain like a brick. Otherwise, you’re only digging yourself a deeper hole!
This one is extremely important to me, as I am just starting to fully realize the importance of this. In short, our minds are only so big. Some may be able to memorize and store more memory in their brain than others (I suppose they have a bigger hard drive, if you will…) but ultimately, we all have some sort of storage limit.
- What is the third parameter in
- Does the string you’re performing the method on go in front of the method, or after?
- How on earth do I loop through objects again?!
These are all great questions — however, it’s unrealistic to fully memorize each of these 100%, right off the back of your hand.
What is even more important is memorizing that you can do these things in your language, not how, but can!
When you know you can do something, then it is just a matter of researching, refreshing, and reminding yourself how to do it. Do not expect yourself to remember exactly how to do all of these things off the top of your head! This is why we have Google!
I used to think I had an open mind — then I started learning to code. I say this because the amount of possibilities to solving a problem is outrageous. It’s what is so beautiful about coding, but also so intimidating about it!
If you’re anything like me, when learning something new, you want to be sure that you’re doing it right. What I’ve quickly grown to realize is that there is never a right way. There is a successful way — if the code works, it works! As a beginner, this is typically all I’ve been focused on.
While having an awesome single line of code that condenses 37 lines of code is awesome, don’t expect yourself to conjure up that solution on your first attempt! It takes time, patience, and actual skill, to fully understand what a problem is asking, and then also finding a solution to that problem.
I have found that once I discover how to solve a problem, then I can go back and revise it. Condense it down. Convert it to a simpler syntax. However, trying to solve a problem with short, concise code, is often not the most convenient way to go about solving a new problem — especially if it’s so concise you’re struggling to understand what you even just wrote!
To my point, problem-solving is a several step process. Don’t be afraid to jot down some spaghetti code — if that was the only way to solve it in your mind, congrats! At least you figured out a solution, now you can challenge yourself to clean up your code!
Extremely important to understand — you can waste time! However, what I am referring to in this example, is more of a niche example.
When I first starting learning, I adopted this concept in my mind, where any second I stepped away from my computer — that time was wasted. Gone. Finished. Dust in the wind. I constantly felt like I was failing if I stepped away, had a snack, caught a breath of fresh air, or even had a short conversation with someone to exchange thoughts — but this is not the case!
I’ve learned the extreme importance of taking breaks. They allow your mind to relax for a second, calm down, and recenter itself. Often after hours of code, your mind begins glazing over typos, poor indentation, and missing brackets (those missing brackets are the worst!) — However, a quick 5-minute break has a plethora of positive effects.
If incorporated responsibly, and in moderation, short breaks are a great way to detox the mind. As a matter of fact, when I have been my most stuck on a problem, I have eventually found the solution when I wasn’t even at my computer! Countless times I have stepped away to have a meal, get ready to end my evening, or go on a walk, and out of nowhere — BINGO! The solution just forms its way into my head and I suddenly jot down the idea in my notes, or write down the make-shift solution on paper, then go and implement it.
While this typically isn’t the exact solution to my problem, many times it has been 99% there, and after some minor refactoring and adjusting, the solution works! It’s a great example to reinforce the fact that breaks are very, very, crucial when learning, or building!
Ultimately, patience is the most important habit when learning to code — or anything new for that matter!
- You are going to make mistakes.
- You will be extremely confused, more often than not.
- You definitely will have to delete and re-do code very frequently.
- You most likely will not have the cleanest, most concise code, on your first build/solution.
This is all okay! This is part of the journey and learning experience. Personally, this reason alone is why I love coding. I enjoy the challenge, seeing the growth happen, and the eye-opening experience it has brought me so far. Being able to use your creativity to problem solve, build, and work with others is always a blast — but then, being able to push yourself even further to improve your code, find a better solution, or refactor your whole design, is what helps us grow!
These are some important reminders that I reflect on a daily basis, and I hope you find some value in them as well. I’m always looking for a better way to improve, and these help me do that!
With that said, remember — the journey is a marathon, not a sprint!