Make it Fun
Here is a fact: if it is not fun, you will not stick to it. This is how you can make coding fun.
Start by building something fun and silly, something that, really, really interests you. It could be the lamest thing in the world. It could be something completely useless. It does not matter. Do not build another calculator app like everybody else tells you to. Unless, of course, you are really into calculators. Then by all means go ahead.
Making it fun is ten times more important if you are a beginner. Because coding is challenging in the early stages. You often feel stuck. So if you cannot enjoy the process, you are likely to quit.
Do not approach coding sessions like they are a chore. Come with the curiosity and wonder of a child. Experiment. Mess up. Get frustrated. Fix it. Break it. And do it all over again. Just make sure you are enjoying it.
Does it mean that coding will be a blissful ride all the time? No. Coding is inherently challenging. But it should not feel like a chore either.
Develop a Ritual
Consistency creates greatness. Not inspiration or motivation.
If you can, develop a habit of coding at the same time. Ritualize the process if it helps. What is important more than anything else is that you show up, and you show up even when it is not fun.
You cannot control whether coding today will feel awesome or if it will feel laborious. What you can control is the effort you put in, the mentality you show up with.
Set breaks in between bursts of work. Do not overwork yourself into fatigue. Stare out of the window for a few minutes. Listen to your favorite song. Close your eyes and meditate.
And when you have your mental clarity back, get back to coding.
Learn Strategically
Please, do not be like me. Do not do what I have done in the past. When I wanted to learn React.js a couple of years ago, I sat through an entire 44-hour-long Udemy course. At the end of the course, what did I retain? Barely anything.
Do not just learn for the sake of learning. Learn practically. Start building first. And learn as you go.
Learn due to necessity. When you get stuck, Google it. You will retain a lot more information when you learn it with a purpose in mind, when you practically apply it immediately.
While watching a long Udemy course can feel productive, that is just what it is — it only feels productive. You are not learning much. Our brains learn by doing, not seeing.
So, build first, learn later.
Share Your Work
Do not just code into the void. Share what you build on public domains. Put it on GitHub, Discord, Reddit, YouTube, or just show it to your mom.
Having others recognize the existence of your work is a powerful motivator. Knowing that somebody other than you will be looking at your work can elevate its quality. You begin to think about things you would not have otherwise.
Have an accountability partner so you do not become complacent. Share your personally set deadlines with them and see the power of accountability push you beyond your self-imposed limits.
Collaborate With Others
Humans love building together. Not only is it a great bonding exercise, but collaboration can compound creativity and innovation. On top of that, it is just fun.
When you feel out of sorts or demotivated, your partners can lift you.
Collaboration provides a chance to break out of your fixed ways of thinking and working.
Master the Art of Lazy Efficiency
As you progress in your coding journey, start becoming more than just a “coder.”
Become an architect, a designer, an artist.
How can you automate it? How can you make it reusable? Does it have to be done this way?
Do not always work harder. Look for ways to work smarter.
Let robots do the mundane, repetitive, and uninspiring work. Save your mental resources for the grand ideas.
Choose the Right Aesthetics
The coding environment in which you work matters. Choose a good-looking font. Pick a powerful code editor. Choose a pleasing theme.
In short, construct a workflow that works for you.
If you want to code in MS Word, then code in MS Word. I will not judge you. Actually, I will, but who am I?
Patience
Without patience, even the best of strategies breaks down. Patience is the foundation of every successful endeavor in life.
Coding will not always be fun. There will be times when you are stuck, when you just cannot seem to get your head around a concept or idea that you need to solve a problem, when the bug makes you want to pull your hair out. There will be times when you share your work, and others do not think much of it. Collaboration might slow you down because of tension or conflict. You might be stuck doing a cumbersome task because you could not automate it.
Remember, when nothing seems to be working, patience will.
Happy coding!