Share Solutions to Your Problems
As a programmer, it can be really hard to do some things that seem incredibly simple. One example from my senior project was trying to find an AngularJS module to find the latitude/longitude of a street address (geocoding). I spent half a day Googling, and trying out many potential solutions before I finally hacked together something that worked. This is a really painful process, and I seem to encounter this several times every year… probably once per month actually.
Once I had a working solution I did the next logical thing, make an example and share with the world! (Check it out on GitHub.) Maybe nobody will ever use the code, or even see it — but that doesn’t matter. What really matters is that I’ll already have a working solution if I need to accomplish this task again. More importantly though, I’ve exercised the “deep thinking” part of my brain; the next time I face any problem I’ll be more equipped to analyze it and determine a solution in less time.
Let’s take a step back here, and look at this from a higher level. Here’s what happened:
- I had a problem.
- I looked for a solution, and didn’t really find one.
- I struggled for significantly longer than I needed to.
- I finally found a solution.
- I was so relieved to find this solution that I isolated it (built it) and shared it with the world.
Upon further reflection, this is essentially how some of the most popular open source projects were created! (Linux, Git, Django, WordPress, and Oh-my-zsh come to mind).
If you can’t explain what you did and why, you’ll only set yourself up for a bigger headache later when (not if) you encounter a bug related to the hack(s). I suppose you can learn by hacking blindly… (We all started there, right?) But, knowing how and why your code works will make you a better programmer in the long run.
In a broader context, creating and documenting solutions for your problems seems like a great way to really understand them. This doesn’t need to be limited to programming, startups, fitness, or filing your taxes. If you have a problem, chances are somebody else has that problem. When you share your experience, you’ve made it that much easier for the next person to find a solution.
What’s the craziest programming problem you’ve found a solution for this year?