How do we solve problems? That is a question that I have been asking a lot of students at Bitmaker Labs recently.
There is a myth that we, humans, should be able to sit down, and with no prior experience, be able to solve problems that we have never seen before. I think the idea is that if we can do this then we are somehow "smart".
My hypothesis (yet unproven) is that this comes from university and traditional school in general. We are taught from a very young age that all of our work has to be original. Copying is evil! Only the poor students copy; the smart students solve their problems on their own.
The problem is that, for many students, this gets translated into, "I have to come up with a solution out of thin air". The reality is that this just leads to frustration, low self-confidence, and abandoned projects.
So how do we solve problems? As far as I can tell, we pattern match. We take the problem, find a similar problem that we know the solution to and then apply a few variations.
When I was in art school, one teacher, very early in the year, told us that we needed to look at every magazine, newspaper, billboard, etc., that we could find and rip out and file everything we liked. Then, when we were running low on inspiration, the idea was to look through everything we had saved and look for new ideas.
There are no truly new ideas. Everything is just a variation on something that came before.
How does this apply to future software developers. The trick is to read as much code as possible. If you are just starting out, read other people's solutions to the same problem you are trying to solve. If you don't have the patterns in your mind, then how do you solve the problem?
Software development is all about solving problems, but in order to do so, you have to fill your brain with as many solutions as possible. The more solutions, the more problems you can solve. The more problems you solve, the more solutions you have. It's circular and starts with seeing and understanding solutions.
So, if you are just starting out, give up the idea of trying to solve problems you have never seen before. Instead, go read, copy, borrow, and understand as many solutions as you can find. Then apply those solutions to new problems and see how they fit. Change them if the fit isn't perfect and learn new solutions.
The only successful way to learn is through pattern matching, but if you don't have the patterns to match to, it just ain't possible. Go find the patterns then go and solve the problems.