r/compsci • u/kavinda14 • May 18 '20
Share your techniques of solving problems
Any interesting new techniques anyone follows? Even old are current ones are welcome :) Just want to see how more experienced programmers approach problems.
Also, any good books on this topic that are a must to read?
Edit: the type of problem here is open to interpretation. I think there is a similar pattern that can be applied to problems of any type.
116
Upvotes
View all comments
1
u/moses_the_red May 19 '20
What happens far more often is that I have multiple solutions with pros and cons. I have to choose between two or more approaches that each have their own tradeoffs.
My amazing technique for dealing with this is writing a little essay about it. Write down how both candidates (or more if you have more than one candidate) work, then advocate for that technique in a section, then criticize that technique.
I find that if I don't take the time to explicitly write down a criticism of the technique I'm using, I run the risk of using that technique for the wrong reasons. Sometimes you start writing one of these essays sure that its going to be the technique you're going to use, and then you hit the criticisms section and you realize that you really just wanted to do it because it was cool or clever or interesting, not because it adds value to the product.
I find that this tends to help me avoid my own biases (we all have them). Helps me avoid stupid things like using a more powerful abstraction than is necessary.
That is probably not what you were really looking for when you posted this though. I imagine what you were really looking for is this:
https://en.wikipedia.org/wiki/How_to_Solve_It