How I am learning Go by building mini side projects and you can too

How I am learning Go by building mini side projects and you can too

Hey everyone, this year in 2023 I started building side projects to learn. My aim was to build something useful for people to help them in their daily lives. This year I have built around 10 side projects compared to only 2 last year.

Last month I decided to learn Golang and what better way to do it than diving into a side project, right?

While searching about Go I came across Go by example and went through it to get a basic understanding of Go's syntax.

After that, I decided to start working on the Go version of one of my side projects todos, which is a terminal-based todo list app for people who love to use their terminal.

I started building todos(go version) with the idea in mind that I wouldn't be using any database for it. The user will be storing all of their to-do tasks on their device only. To tackle this I created a todos.json file to store all the tasks of the user.

Now by referring to "Go By examples" I started working on different functions of this todo app and completed it mainly in 2-3 days by giving it 30-45 minutes per day.

Some days passed and I came across a post on LinkedIn by John Crickett where he talked about Coding Challenges. I clicked on the link and opened the website and to my surprise, there were a lot of interesting coding challenges to build projects around. So I thought it would be great to learn and practice Golang by building some of these projects.

So I chose to build a rate limiter. I was familiar with the concept of rate limiting and had worked with some of the rate-limiting libraries in Python but now it was time to build a rate limiter of my own.

If you're not familiar with the term "rate limiting," think of it like this: Imagine an API endpoint that provides valuable information or services. Now, picture a user attempting to flood this endpoint with numerous requests. This surge not only cranks up the server's workload but also risks knocking various services offline. To ward off this potential abuse, we use rate limiting. It's a strategic move where we define a specific rate – say, the number of hits the API can take in a given time frame, let's say minutes – to maintain control and keep everything running smoothly.

Now moving on to the building part.

To build the rate limiter I decided to use Token Bucket Algorithm. After some googling and reading different articles, I built the first version of rate limiter. You can find it here.

It was a good weekend project that helped me gain knowledge about what are the different algorithms used for rate limiting and how we can use them to create our own rate limiters. My future plan is to rate-limit the user based on their IPs.

My journey of learning Go by building mini side projects has been both rewarding and enlightening. I built these projects in public and this exposed me to how different ideas are curated into products that people can use.

The building in public thing fueled me with energy to work on my latest side project sideProjectss which is a platform where Developers, Designers, Freelancers, students and people who want to showcase their side projects can come and create a page showcasing their side projects in less than 5 minutes. I have been receiving positive feedback from different people across Twitter and Reddit. Its currently in beta and you can try it out by going to this link.

Here's my sideProjectss page: sideProjectss.com/Utkarshn10

With this, I would like to end this mini blog. Hope you like it and are inspired to work on side projects to hone your skills. If you are building in public then do tag me on Twitter (would love to support you there).

Thank you for reading and I will meet you in the next blog.

Did you find this article valuable?

Support Utkarsh Nagar by becoming a sponsor. Any amount is appreciated!