Eight rituals to be a better programmer
Tags: productivity, beginners
Published: 2020-02-28 18:11:59

"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](https://www.codechef.com/), [Spoj](https://www.spoj.com/) or [HackerRank](https://www.hackerrank.com/)) 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](https://twitter.com) clone, an [Instagram](https://www.instagram.com/) 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

  - [projectile motion](https://en.wikipedia.org/wiki/Projectile_motion)
  - [double pendulum](https://en.wikipedia.org/wiki/Double_pendulum)
  - [solar system simulation](https://en.wikipedia.org/wiki/Numerical_model_of_the_Solar_System)

There are lots of libraries and framework like [p5.js](https://p5js.org) 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](https://dev.to/), [Hashnode](https://hashnode.com/) and [Twitter](https://twitter.com/) to find and interact with like-minded people.

### Action Items

 - collaborate on a project once a year
 - be active on platforms like [Dev.to](https://dev.to/), [Hashnode](https://hashnode.com/) and [Twitter](https://twitter.com/)

# 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](https://en.wikipedia.org/wiki/Functional_programming), [Polymorphism](https://en.wikipedia.org/wiki/Polymorphism_(computer_science)), [Event driven programming](https://en.wikipedia.org/wiki/Event-driven_programming), [Actor model](https://en.wikipedia.org/wiki/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 you might like:_

[Personalize your python prompt](https://arpitbhayani.me/blogs/python-prompts)
[Pseudorandom numbers using Cellular Automata - Rule 30](https://arpitbhayani.me/blogs/rule-30)
[Overload Functions in Python](https://arpitbhayani.me/blogs/function-overloading)
[Isolation Forest algorithm for anomaly detection](https://arpitbhayani.me/blogs/isolation-forest)
[Everything that you need to know about Image Steganography](https://arpitbhayani.me/blogs/image-steganography)

_This article was originally published on my [blog - Eight rituals to be a better programmer](https://arpitbhayani.me/blogs/better-programmer)._

_If you liked what you read, subscribe to my newsletter and get the post delivered directly to your inbox and give me a shout-out [@arpit_bhayani](https://twitter.com/arpit_bhayani)._

[![Subscribe to Arpit's newsletter](https://user-images.githubusercontent.com/4745789/74005152-fc4fc200-499d-11ea-9df7-9f6733a06aa8.png)](https://arpit.substack.com)