Trusted by millions of Kenyans
Study resources on Kenyaplex

Get ready-made curriculum aligned revision materials

Exam papers, notes, holiday assignments and topical questions – all aligned to the Kenyan curriculum.

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

Answer Attachments

Exams With Marking Schemes

Related Questions