Code stabbing - happy accidents and headaches.
If you’re a fan of FreeCodeCamp, CodeWars or other code training websites you will no doubt be familiar with completing challenges, bonfires or kata. The idea behind them is that you usually get a short scenario and then have to solve a problem with a small bit of code. I find them a good way to put into practice some things which otherwise might be a bit abstract. For example, understanding how to chop up strings might be a trivial concept but when the purpose of doing it is to check for palindromes well, it has a whole new meaning.
It’s not all good news though. Whilst on my code stabbing evenings I have had successes I have also been met with numerous dead-ends, problems and headaches which even the recommended dose of paracetamol could not resolve. This does mean it can take longer to solve what would perhaps be a simple problem and does have the side benefit of spending hours on the Mozilla Developer site trying to comprehend how call, bind and apply are different.
The end result I feel is that a little bit of code stabbing now and then is not a bad thing. It pays to tinker. It can be beneficial to experiment. It can be quite fun. I guess that we just need to be conscious not to let what could be a bad habit, creep in to professional work.
Do you think stabbing around for solutions to code can be useful?