But maybe you feel uncertain about doing it yourself and have trouble turning your thoughts into code at first even though you understand the syntax or logic.
Here’s my process and some tips to tackling a sample problem that hopefully some of you may find helpful in your journey. There is a difference between the problem and the problem you think you are solving.
See if you can reduce any steps or if you are repeating any steps.
Even after you’ve worked out general steps, writing out pseudocode that you can translate into code will help with defining the structure of your code and make coding a lot easier. You can do this either on paper or as comments in your code editor.
Refer back to the problem to make sure you are on track.
When you have your pseudocode ready, translate each line into real code in the language you are working on. If you wrote it out on paper, type this up as comments in your code editor. Then I call the function and give it some sample sets of data we used earlier.I once was asked to make a game like Hangman that I realized was “Evil Hangman” only after I read through the instructions (it was a trick! Sometimes I’ll even try explaining the problem to a friend and see if her understanding of my explanation matches the problem I am tasked with.You don’t want to find out halfway through that you misunderstood the problem. The better you understand the problem, the easier it will be to solve it.You understand the problem, the logic, basics of the syntax, etc.If you see someone else’s code or have someone to guide you, you can follow along.If this is challenging, try using large sets of data as it will override your brain’s ability to naturally solve the problem just by looking at it. I have some sets with just one element, some with floats instead of just integers, some with multiple digits in an element, and some with negatives just to be safe.Look for patterns and see if there’s anything you can generalize.Even experienced developers are always practicing and learning. Remember that programming, like with anything, comes easier and more naturally with time.20 Experts have compiled this list of Best C Tutorial, Course, Training, Class, and Certification available online for 2019.When I encounter bugs, I trace the code line-by-line to see if there was anything that did not go as expected.Here are some techniques I use: You may not always remember what every single line meant a month later.