Tuesday, April 6, 2021

Looking at Something From a Different Angle

As I thought about this post, I feel like I've written something to this effect before. Struggling with an issue when there is a very simple solution right in front of my face. Then finally seeing the more simple solution and implementing it. It does actually feel good in the end and that's what I will write about today.

I am developing a personal efficiency program. I enter certain activities and they have point values. I also put how many minutes I spend on each activity. Then when I look back I can see if I have been productive with my time and can make adjustments accordingly. I know it's impossible to reach, but 100% efficiency is the dream! I don't factor in my job or sleep, or even eating and such. But, things like watching TV is generally not efficient. Coding or studying Hindi on the other hand...

I designed it so that there is a database table for "ActivityTypes" and "ActivityEntries" I actually do. The problem is: what if an activity type is no longer valid and needs removed? Then I would have to have the program go through all entries that include that activity type and remove data from the column for an activity type on that row. Then before I knew it I was going down a rabbit hole of creating a new activity type of "Deleted Activity" and then using that to enter into the Activity Type column in the Entries table for when an Activity Type was deleted. That was just causing some confusion in my brain.

At last I had an epiphany of sorts. Why not just add a column in the Activity Type table for whether or not the activity type is valid/still in use or not? Then if an Entry had an activity type that was not valid it would just display a message letting the user know that the data might be inaccurate. That was very easy to implement. Then I just have 'activate' and 'deactivate' toggles if an Activity Type needs removed. It also makes it very easy to make an activity valid again. Data integrity is also there so that if something is deleted by mistake it can easily be undone.

Do you remember the scene in Big Hero 6 where Tadashi holds Hiro upside-down so he can get a new perspective and stimulate an idea? That's somewhat how I felt. Looking at the problem one way was not leading to progress. But doing something a completely new way gives just the inspiration needed to accomplish what was needed.

I know there will be bigger problems in the future. Ones that will require a different function or library to implement to solve a problem. If I keep in mind that there might just be a simple solution outside of my field of vision, I have to remember to lean back, or upside down perhaps, to find the obvious and easy solution.

25 Words or Less: Take a step back and try to see a problem from another angle. The solution might just be easier than you think.

No comments:

Post a Comment