Skip to main content
Post Made Community Wiki
Source Link
sharkin
  • 191
  • 1
  • 3

It's easy for a programmer to mentally attack a problem by visualizing how to solve the problem with their favourite programming language. Just like the classic carpenter who sees all problems as nails when his favourite tool is the hammer.

I think the best problem solving exercises comes when you get above the practical level and just think in terms of "this is what I would need in order to solve it in an optimal way". In some cases you may have to learn (a lot of) new stuff to apply the solution at all, but the key point is that your ability to work out a solution shouldn't be limited to your historical and existing techniques.

An old practical example for me is that I learned how to implement efficient cooperative multitasking when I realized that my problem didn't actually need preemptive threads, even though I usually would have gone right ahead to my comfort zone banging up all those mutexes (that eventually always seem to stop being comfortable at some point..).