STUCK ON CODING? DON'T GIVE UP!

STUCK ON CODING? DON'T GIVE UP!

If you are reading this, then you can probably relate to the short scenario I'm about to give. You've probably experienced worse or something crazier.

Imagine that moment when you've written more than 500 lines of code and it's time to run it, then.....

image.png

That frustrating moment when you get a syntax error or you have to read a traceback yen yen yen and you really don't know what else to do. Before you know it, you're stuck on one persistent problem for 6 hours or more and you can't just figure it out. Trust me, I've been there; in fact, I almost ran out of my mind 4 days ago after working on a problem for almost 8 hours with no solution in sight.

Before I discuss what you should do when you get stuck again, let me remind you of one thing: As a programmer, it is your daily cross to encounter errors frequently or occasionally. In fact, it is a healthy exercise to encounter errors because you'd have to troubleshoot, debug, and try different approaches to getting that nasty little bug fixed. In the process of debugging, you have learned something. The upside is that next time you encounter a similar error, you know what to do! Capisce?!

The next time you are stuck on a problem, please follow these steps:

  • READ, READ, READ

Before you can clear the error, you need to understand the nature of the error. This step is by far the most underrated step as many people just prefer to find quick answers to the problem they are encountering and be done with it. This is not healthy especially if you are a data scientist in the pipeline. Rigorous learning (including learning from mistakes) are crucial to developing and enhancing your skills in your chosen field and you should grab every chance to learn. You don't want to make the same mistake TWICE!

  • MANUALIZE YOUR PROBLEM - SOLVING APPROACH

This may seem vague or outdated as many programmers do not see the relevance. However, it has been proved that understanding your input data, performing random tests with different dataset categories as well as documenting each step as you go is an extremely effective way to understand your input data as well as your codes. Do not write your final code yet, keep trying and testing the process with more data and it is assured that your final code won't suck as you might imagine it would.

  • WRITE PSEUDOCODE(S)

Every programmer might be able to relate to this but its relevance and effectiveness cannot be emphasized enough.

Pseudocode is an informal high-level description of the operating principle of a computer program. Simply put (without making your brain itch ), it is a detailed description of how your algorithm or codes must look like. By writing them out, you have a pretty good idea of the corresponding codes you have to write and the flow when writing your codes is smooth. Here is an example of pseudocode:

90472-147-635182861185610073_338x600_thumb.jpg

After doing all these, what do you do next?

Find out in the next part of this article which comes out SOON!

STAY TUNED AND KEEP CODING!!