Skip to main content

Household bills Program

· 5 min read


In this blogpost, I share my journey of creating a program to split household bills. This was my first side project where I used Java to create a GUI application.

The open source code is available here.

My first side project.

Before University, I spent most of my spare time playing counter-strike (my steam account had more than 1000 hours played, that’s more than 41 entire days playing in a row). I was a decent player I’d say, you can see a compilation of “almosts” I’ve done here.

However, I knew this wasn’t the way. I realised that if I used the amount of time I was spending on online games for learning, I would have a much bigger satisfaction return. And, in the long term, my life would be better.

So I started studying hard. I started valuing my time more, and declined most of the parties I was invited to because I was busy working late hours. Don’t get me wrong, I’m an easy person. I like to think I make friends easily. However, I just had different priorities, and partying just wasn’t one of them. As my parents say: “Everything has its own time”.

In my 2nd year of University, I was getting really good grades, which means that I started having discussions with the other best students in the course. That’s how I met one of the smartest people I know to this day. This guy was a proper hands-on person, he didn’t study half the time I did, but he was always busy with something.

He had a band, developed his own personalised guitar pedals and amplifiers, and developed some apps for fun. He did this all while having excellent results at University, which is insane. That’s when I realised that he was not only giving more priority to these hobbies in relation to partying or meeting people, BUT also in relation to doing courseworks or studying for exams. He’d never fail a coursework/exam, but that further study could have bumped a grade from 17 to a 19 out of 20.

One day, we were meant to meet at his place to work on a coursework together, and he shown me an app that he had developed for him and his girlfriend. The app was a simple command line interface that was able to split their usual household bills (rent, water bill, food shop, cat food, etc). I found that fascinating.

I told him I would create one for myself. Since I had read about how to use Java to make a pretty GUI, I thought why not give this a go (although I had no idea about OOP). In addition, I didn’t want my program to look the same as his, so I thought my version could be as if it was an upgrade.

...

After that, I was on a mission. Little did I know that after this, I never really stopped having an interest in working on new side projects.

The planning steps were:

1. Decide main features. Add new household bills to split, Give money, and See bills.

2.Sketch what the GUI should look like

3. Devise data structure associated with a new Household bill split. This was important for both coding, and also database management.

4. Work out the math associated with the splitting and giving

The development process was to “divide to conquer”. I split the tasks into several sub-tasks, and after every new little code change I was testing the code to make sure that nothing was broken. I re-iterate through design and code several times, until I was happy with my solution. Then I did some clean-up/improvements, such as: Adding pictures of the users, Login password, Frenchies as icons.

On a funny side note: As I didn’t know how to work with DBs at that time, I used text files to save and load all the information. Meaning that if my brother ever opened one of those text files (which weren’t properly hidden…), I could have passed from him owing me 100 euros to me owing him 10 million. The software was on his laptop, and I had an hardcoded password, so in theory he couldn’t manually add any bill without my presence — I guess that was enough for him to think that the product was bullet-proof.

See images below of the program:



You can find more information about this on my GitHub, here.

The program ended up being used for more than 3 years. Since I lived with other people other than my brother, I had to update the name/image on the program to represent that. Since I was new to coding, I didn’t think about the future. Therefore, when that time came, I had to manually replace the names one by one in the code. I also had friends requesting to use the program, which lead to me adapting this to their names/figures.

It was a fun project and I definitely learned loads from it. The most important thing was that I was able to do whatever I wanted software-wise as long as I dedicated enough time for it.

Hope you had a fun read. Thanks!