Get premium membership and access questions with answers, video lessons as well as revision papers.

Explain five good programming practices

      

Explain five good programming practices.

  

Answers


lilian
1 Comment. Add comments to your code in plain English (or your native language if the other programmers who will be reading it also speak the same language) that describe both what the code is doing and why you decided to do it one way and not another way that somebody reading the code might think of on their own.

2 Don't assume output formats. Sometimes data will get output to the screen, other times to a printer, and other times it will get logged to a database.

3 Use globals sparingly. Global variables suck.

4 Consolidate literals. Literals belong in a centralized spot (e.g. a separate module or a database), not sprinkled liberally throughout your code. That means you should refer to them symbolically (i.e. by name, not literal value).

5
Be consistent with formatting. There's nothing worse than code that is difficult to read because it is poorly formatted.
limooh answered the question on June 13, 2018 at 09:27


Next: Name the basic goals of development
Previous: Discuss the role played by merging African elites in the attainment of Kenyan Independence

View More Computer Science Questions and Answers | Return to Questions Index


Learn High School English on YouTube

Related Questions