Eight rituals to be a better programmer
"How to get better at programming?" is the question I had been asked quite a few times, and today I lay down the 8 rituals I have been following, and action items for each, to be good and get better at programming.
Code exhaustively
Doing something repeatedly always helps and writing a lot of code will develop our ability to
write code while we think
think faster, think better
foresee requirement changes and possible logic extensions
Action Items
One significant contribution to a project every two weeks
Solve at least two programming questions (from Codechef, Spoj or HackerRank) every week, till we solve at least 300 questions
Code consistently
If we don't do something repeatedly, it becomes extremely hard to get good at it. Writing code consistently helps us
define the programmatic and algorithmic flow quickly
build a habit of programming and thinking analytically
Action Items
make one small contribution to anyone project every three days
Once a while build a complex system
Solving programming questions is about developing logic but things become a little trickier when we build a complex system, as it requires us to take our programming skills to go up a notch. Some examples of complex systems are - a Library management system, a Twitter clone, an Instagram clone, etc. Building a complex system
widens our tech stack
makes us keep our code flexible, extensible and reusable
helps us understand how to split our code into independent segments that work in harmony
Action Items
build one complex system every 4 months
Once a while build something inspired by the real world
After we spend some time writing programs and solving problems, things become monotonous and do not seem to challenge us anymore, so to spice things up a bit we should model something from the real world, like
There are lots of libraries and framework like p5.js that makes visual programming simple.
Action Items
once every 6 months model a physical phenomenon
Read super exhaustively
It is not only writing code that improves our programming skills but it is reading some quality code written by expert programmers that make the difference. Reading code written by experts improve our programming vocabulary and by doing this we
learn the best programming practices
discover the new programming paradigms
find ways to properly structure our code for extensibility
The best way to start doing it is by picking up an open-source project and start skimming the code. It is okay to not understand it in the first go but it is important to skim it a few times and get acquainted. After a few skim, everything will fall in place, the code becomes familiar and we start to understand the flow and business logic.
Action Items
pick an open-source project every 6 months and skim its code once every two months
pick a tiny open-source utility, from an experienced developer, every month and skim it
Collaborate with a stranger
There is always someone sitting on the other side of the globe, who knows a thing or two more than us. Look for them and collaborate on a project. The developer community is filled with super smart and super enthusiastic developers who love to share and collaborate. Use websites like Dev.to, Hashnode, and Twitter to find and interact with like-minded people.
Action Items
Fundamentals go a long way
A programming language is just a tool to express business logic. While learning a programming language we should try to understand the constructs and paradigms used - for example, Functional programming, Polymorphism, Event-driven programming, Actor model, etc. It is important to do so because we could pick constructs from one language and use it in another to solve our problem. For example: picking Functional programming (Callbacks) from Javascript and using it in Python to create generic action functions.
Action Items
learn one design pattern every month and build a simulation around it
pick a language construct and implement it in some other language
We think before we code
Writing code before putting in some thought is degraded the code more often than not. The code written like this lacks simplicity, reusability, and extensibility. Spending some time thinking about problem statement or task at hand and having a rough execution plan always helps.
Action Items
always define the scope of implementation, create an execution plan and then code
Conclusion
These rituals have helped me get better at programming with time and in parallel, I pick at max 3 and act on the action items. Programming is simple but being better than most is difficult. Doing it consistently makes one get better by the day.
Other articles that you might like:
If you find this helpful, share this with your peers and give me a shout out @arpit_bhayani