The year 2020 was quite an unusual year as the lockdown brought about by the pandemic meant a lot of us had a lot of time on our hands. I used this time to acquire many new skills and advance/sharpen some old ones. Over the 6 months of lock down I earned 11 new certificates from different IT fields. I started off with digital marketing and you can check out the article about How I Earned 5 Industry Standard Google Digital Marketing Certificates in 10 Days.
Source Code Is Not Your Friend
When I started off learning flutter.dart, I went on GitHub to seach for projects that I could clone/fork and study or reverse engineer as a quick entry way to learning the dart programming language alongside the flutter framework. I think I forked half of GitHub’s dart repos (Exaggeration intensifies). And I soon found this to be a bad idea.
Code is poetry and in poetry there are many ways of elegantly expressing an idea or scenario. In the same way, there are many different ways to get a job done using code and different coders write their codes differently. This means that when you are looking at similar open source UI’s, their code base might be radically different and as a beginner, trying to understand UI’s by accumulating source codes is likely to confuse you to the 7th heavens. You have to develop, discover and explore your own unique way of writing code by learning the coding language from scratch.
Start with the simple stuff like displaying text, centering texts, displaying images in columns and rows etc. In time, you will be in a healthier position to explore source codes and gather ideas on how to improve your own unique code-poetic DNA.
Source Code Is Your Enemy
That someone isn’t a friend doesn’t inadvertently make them an enemy. But in this case, not only is source code not your friend but it can actually be an enemy if you are a beginner learning how to code. This is because an idea can only go so far outside the mind that conceived it. You cannot sustain what you do not understand. Cloning source codes as a primary way of becoming a better programmer can be counter productive. You need to, at the very least, have an intermediate grasp of the basics of the language you are learning before delving into source codes.
I often see a lot of early stage programmers see a nice UI on YouTube and keep asking for the source code and it makes me cringe. When learning how to code, avoid source codes as much as possible. Instead, go for video tutorials or speed codes and type each code line by line, manually. Do not copy and paste, instead manually type each code in the tutorial video into your IDE. The reason for this is that manually typing the codes will give you somewhat of an in-depth insight into the thought process and logic of the programmer and this will make you ask the right questions and improve your understanding of coding generally.
When following tutorials on making complex UI’s in flutter I manually type(d) hundreds of lines of codes even though the source codes were available for me to clone and study. Believe me when I say that doing this will help you become a more “in-depth” software developer in whatever stack you settle for.
Work With What You Understand
When following online courses and tutorials, very little might make sense to you. When the instructor is talking everything makes sense but when they stop talking, nothing makes sense and you don’t know where to start in implementing the knowledge you just gained, it’s like dark magic. Also, some programming courses introduce concepts like BloC pattern and string interpolation too soon in the course. While your mind is excited about the little things and little victories and still trying to understand how to display an image or text in an app, the instructor is talking about what seems like a step by step guide on how to write a code that will power an autonomous drone designed to probe a black hole in deep space.
In code theory there is something called a WET code and a DRY code. WET(We Enjoy Typing) and DRY(Don’t Repeat Yourself). WET codes occur when you do not reuse components, modularize your code and separate the logical aspects of your code from everything else. This means that you are going to keep rewriting the same code over and over again and any mistake or improvements you want to make has to be written in 2 to infinity different places depending on how big your project is. Dry code occurs when you use the BLoC pattern, write modular codes, reuse components etc. That is separates the logical aspect of your app from other aspects; this way you can easily make changes in one small page in your codebase and it affects a large/growing portion of the app. In essence the general rule of thumb is to avoid WET codes and always strive to keep your code base DRY.
WET codes are often non-scalable, hard to read, and very tedious to maintain because the UI and logical aspects of the app are likely bundled together all across the entire project.
Working with what you understand means that if what you understand is how to write WET codes then I dare say that you should keep writing WET codes and that is okay as long as your app works. Allow your mind to expand naturally. If you force your mind to expand and understand what it is not yet ready to understand then you are likely to reach a frustration level that puts you at a high risk of giving up. If you do not understand the BLoC pattern and how to reuse components then go ahead and write WET codes. Repeat yourself if that’s the only path to progress that you can see. For your first project the most important thing is that you finish the project. This is because the joy and satisfaction that comes from seeing your functional app published on the Play or App Store will energize you through whatever obstacles you need to surmount to move to the next level as a programmer.
You have to protect your interest whenever you are learning something new like programming. Working with what you understand is meant to help you shield yourself from anything that will make you loose interest and give up on what you set out to achieve which in this case is becoming a software developer.
A point will come in your journey as a software developer when you will get tired of writing WET codes and then and only then can your mind expand towards a strong and healthy desire to understand concepts like the BLoC pattern and using builders to separate logic from the UI and iterate through a list. The exhaustion that inevitably comes from writing and maintaining a WET and non-scalable code base will make you appreciate the need to reuse components; and until your mind can appreciate the need for something, it will not be able to make room for the patience and resources required to learn it. It’s what I call the programmers evolution, it’s a natural progression that is unique to every developer.
You have to be patient with yourself. It might take a while before you understand state management, themes, CRUD, BLoC pattern and other concepts. Let your needs guide you, the only thing you should focus on as a beginner is what you need to know to take the next step or add the next feature in your app.
It’s Not An Easy Journey
There are many courses out there that promise to be the holy grail of learning how to be a programmer. They tell you that all you need to do to become a software developer is to buy their course or go through their boot camp and nothing could be further from the truth. Being a software developer is not something you can excel in by doing 1hr practice every day. You have to be ready to block out hours at a stretch and even entire days or weekends if you hope to make a head way.
Prepare your mind for a marathon and not a sprint race because the journey is not for the faint of heart. Prepare your mind like you would your body for mountain climbing. Your resolve has to be very strong. This is something most online coding courses fail to mention. Many (probably most) people who set out to become software developers quit along the way. They quit because they took a machete to a nuclear war.
Be As Stubborn As A Mountain Goat
Frustration is/was the companion of anyone and everyone who has advanced in programming. You have to be very resilient if you are to make it to the light at the end of the tunnel. Some days you are going to feel like you’ve finally hit an insurmountable obstacle; but trust me when I tell you that your mind is stronger than you can possibly imagine. You have to be ready to apply your mind and keep it fixated on whatever challenges you’re facing (for days sometimes). If you focus on the obstacle long enough, it will eventually bend; it either bends to your favour or it bends and lets some light through that shows you a path around it.
One of the most frustrating moments for me was when I was learning CRUD which is all about Creating, Reading, Updating and Deleting data in a remote database/storage from within an app. Finally figuring out CRUD in dart after so much frustration, giving up and un-giving-up’s made me realize that stubbornness(persistence) trumps intellect when it comes to certain things in life.
It Gets Easier With Time and Practice
No matter how hard it might seem, always remember that it will eventually get easier if you stay on it. And by easier I mean this:
Sleep Is Magical
While learning how to code, you are going to encounter bugs and challenges that will make you question your very existence. Yes, be as stubborn as a goat when trying to overcome these challenges but also know when to call it a day and get some sleep. Getting a good night or days rest gives your mind time to process some of the information you picked up while coding. Some coding concepts I couldn’t seem to understand while I was awake finally made sense while I slept. I even saw codes in my dream (most devs do) which while obsessive, made me understand that my mind was still trying to figure stuff out even as I slept. Sleep is part of the learning process.
The solution to some challenges I faced while learning dart came to me intuitively the next day after getting a good nights rest. It seems like sleep is when the mind converts your days experiences and knowledge gained into your instincts, intuition, muscle memory etc. Even though it might not feel like it sometimes, know that you are getting more skilled in whatever you are learning as long as you stay on it, get a good nights sleep and return to it the next day.
Drive Around In Circles
This is similar to being as stubborn as a goat but with a slight difference. Driving around in circles is more about consistency than persistence.
You can see persistence as staying on it through the day or week while consistency is about staying on it or coming back to it every month over a long period of time.
Have you ever watched a movie or read a book more than once and realized that there were some very interesting details you missed? That is what this point is about. With each passing day, you are getting smarter if you stay focused in your software development journey. This means that what made absolutely no sense to you last week might make a little more or total sense to you next week if you are consistent enough to come back to it.
Do not abandon something if you do not understand it right away. Give it days, weeks and even months then return to it. Trust me, you’ll pick up more than you did the last time.
You Do Not Have To Understand Everything
Abstraction is here to stay. In programming, abstraction is “all about” aspects of the software development process like your IDE, packages, libraries, plugins and other tools you use to build your apps that helps you get the job done but you do not know why, or how they work (This is not the most holistic definition of abstraction in OOP but it’s a definition most beginners can work with). It’s the same with your code, you do not have to understanding everything in your code base (Laughs in stack overflow). However, you do need to know how it all fits together.
As a side note: Abstraction is one of the fundamental pillars of OOP (Object Oriented Programming). As you get better as a software developer, you are going to find yourself abstracting aspects of your code base.
This is another reason why you should avoid cloning source codes and pasting your name on it; it robs you of the critical understanding of how it all fits together. Knowing how it fits together will save you a lot of time when something eventually and inevitably breaks. If you know how it all fits together then you’ll know where to look when that mundane error pops up.
While you do not need to understand everything in your codebase, you should understanding most things. If you do not understand most things in your code base then it does not “belong” to you because the owner of the company is whoever owns the most shares.
Research is your friend
As a beginner, you should not worry about scaling; what happens when you get 100,000 users, the best database service that can cost effectively handle 1 million database reads and writes daily, cheap storage etc. Pre-Optimization in software development circles is all about putting together what you believe to be the “best” stack and technologies to future proof your project.
As a beginner your primary focus should be surviving the learning journey to the point where scaling is actually a problem staring you in the face and not a hypothetical problem.
Focus on getting your app to behave the way you want it to. A time will come when you become skilled and successful enough as a developer to work on pre optimizations without the cloud of uncertainty over if the app will even work in the first place.
There are 2 predominant school of thoughts in developer circles and one is to pre-optimize every time, and the other is to never pre-optimize and just focus on making the app work and deal with whatever pops up as it comes. And both are valid paradigms to live by as a developer. It all depends on where you are at any point in time. My advice is that if you are an intermediate to senior developer working on a major project then you should consider pre optimizing, but if you are still a beginner trying to figure out how the basics work and why they work then you really should not bother yourself with pre-optimizing. Post-optimization is inevitable anyway no matter the stack and technologies you choose. The tech field is after all one of the most volatile; if in doubt ask Adobe flash player.