How to structure your programming code?

Remember my first Fumble with basic on my ZX Spectrum computer back in the 1980s, sloughing through pages of basic commands and code with no real idea of how I could write apps myself. It was like reading a dictionary where could learn certain words and their meanings with limited advice on how could assemble them into entire paragraphs to compose a document. Every developer who has dabbled in fundamental has probably encounter the famous Hello Word routine that contains a two-line app that prints this phrase unlimited times on the screen. Your program code needs to be written as step-by-step directions using the commands your choice of programming language knows. It means reading your programming guide to find out which commands you have to use for whatever you want your program to perform.

do my coding

 In the Hello World example you did first require a command that prints Hello World on the screen, and then you would require another command to print it multiple times, without writing multiple print statements. Check out this example. To make things easy am using old-school fundamental with line numbers – probably because am a retro-freak. The best structure for writing any program code is to make it clear and simple to follow. Some developers put multiple commands on a single line that may make your code hard to follow if you are trying to iron out bugs. Spreading your code over several lines really makes the program work better and becomes more readable in this site domycoding.com.

Another recommended Practice would be to separate each component of your program code using REM Statements. REM short for Remark lets you place comments before each section of code to remind you what each part does. This is particularly helpful if you would like to edit your code in a later date. Anything after the REM Command is ignored by the computer and you can use as many REM statements as you wish to make larger gaps in your code for effortless reading. Other programming languages enable you to use blank lines or indent the first line of this routine will show you the way to structure the whole program code. Do not forget that the computer should follow step-by-step instructions so that you want to write each instruction in the sequence you want it to run.