Struggle Free Programming. “Mistakes are a fact of life. It is the…
Tags: Tdd, Computer Programming, Tips And Tricks, Compilers, Programming

How to Program without any struggles.

“Mistakes are a fact of life. It is the response to the error that counts.”

— Nikki Giovanni.

Hello Learners,

This blog talks about “How to Program easily”. I have shared my experience and research that makes my programming confidence much better. When I was a newbie to a Computer Technology degree, I literally didn’t know anything about programming. I simply typed, coded, compiled,and expected for an output. At that time, all I expected was to get output without any error. But after some time, I realized that I was completely wrong and I must improve my programming skills. I started to study What programming is.

What is programming?

Programming is a set of instructions/ code that tells the computer how to perform a specific task. Computer Programming is all about creating a code in an orderly sequence that has to meet the expected output.

Why programming?

There are around 600 programming languages at present. New programming languages are going to develop and it is like a looping process because humans need advanced programming languages in order to cope with advanced technologies. Every programming language is best on it’s own.

How to solve programming problems using a step approach?

You know that you want to end up with working code but going straight from a problem statement to working code is not right to gain much knowledge on programming. It can take some significant thought and work. This is why we must break it down into six steps, which gives us a manageable approach where we will know what to do next to solve the problem.

This is a six-step process that we must use whenever we are solving programming problems that are difficult. When your programming skills improve, you will know the correct order to crack your problem statements.

What are the steps to follow?

Step 1 — Try to solve your problems by writing down on a paper.

Step 2 — Think about the correct sequence of patterns.

Step 3 — Examine your code by hand ( Think of yourself as a Human compiler)

Step 4 — Convert your answers into code.

Step 5 — Make test cases, compiler, and run your code.

Step 6 — Debug failed test cases.

What is the TDD approach?

TDD stands for Test-Driven development. TDD is being quickly adopted by software developers for developing application source code. TDD improves the quality of the code. It makes code easier to maintain and understand. If you code your problems step by step, it will help you to debug easily.

My suggestions for an online coding platform

Chances are wide if you take it. If you don’t have a programming platform like TurboC/ Netbeans / JBK/ Python idle, no problem there are many online compilers to change your bytecode into machine-level code to provide answers for you. Here are my suggestions on online compilers to code and make test cases for your problems.

Example on Six-Step approach.

This example is sum of two digits code in JAVA

Step 1

Write down an algorithm/ pseudocode and flowchart for the problem

-Start

-Declare integer variables num1, num2 and sum.

-Add num1 and num2 and assign the result to sum. sum=num1+num2

-Display sum

-Stop

Step 2

Write and the correct sequence of the problem as code on paper.

Step 3

Examine your code by checking syntax and semantics.

Step 4

Translate to code. If you don’t have a programming platform using online compilers.

public class AddNumbers{

public static void main(String[] args){

int num=1, num=2, sum;

sum = num1 + num2;

System.out.println( “Sum of two digits is “ + sum);

}

}

Step 5

Make test cases/ compile and run

Step 6

Debug your code and go back to step 2.

“Take chances, make mistakes. That’s how you grow.”

— Mary Tyler Moore.