DEV Community

Raji Ayinla
Raji Ayinla

Posted on

I built a tax calculator for freelancers

Alt Text

I built a tax calculator for freelancers. The project started out as a personal one. I wanted a super simple way to calculate my taxes owed from my contract work without having to deal with all the bells and whistles you find on other sites.

But as I started working off my coding rust, I couldn't stop fleshing out the calculator. I decided to include every state and the filing year of 2019 and 2020.

The calculator is still simple though and doesn't give you an option to input deductions. The income input assumes you already know your net taxable income. It's also just an estimate, so definitely verify and consult with a tax professional. The point of something like this is to give you a solid idea of what you might owe before you start chopping off your liability with deductions.

What did I learn from my experience? I've written a couple of articles that stress learning to code by building things. So, it was probably a good idea that I followed my own advise. In doing so, I surprised myself by how quickly I was able to pick up patterns and then abstract that pattern into functional, modular code. You know when code is functional and modular when you can use it in different contexts without fearing that you'll break something.

This small project really showed me its importance because as I started adding more and more data, I didn't have to stress about whether the app would break. If there was an error, it was usually because of the data, not the algorithm.

The modularized algorithm allowed me to spin off a cascade of useful functions that were easy to reference. There are still improvements I can make to the code to increase the speed. I though about memoizing the arithmetic involved in the tiered tax calculation, but the nature of the calculation doesn't really call for it.

Here's the website I made for the calculator. Enjoy:

Top comments (0)