---
title: "Good programming practice and software selection"
subject: "Instrumentation II"
chapter: 9
key: "semester_5/instrumentation_ii:good-programming-software-selection"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/good-programming-software-selection
site: BCT Engineering
---

# Good programming practice and software selection

Instrumentation II · Chapter 9: Software For Instrumentation And Control Applications

- Asked in: 2073 Chaitra, 4+4 marks; 2071 Shrawan, 3+5 marks (asked 2 times)
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/instrumentation_ii/good-programming-software-selection
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-9

## Question

Explain the approach for good programming practice. What are the basic criteria for selecting a company for purchasing reliable software?

## Short answer

Good programming practice includes planning, modular design, structured code, clear naming, defensive programming, and reviews/version control. A reliable software supplier is chosen based on reputation, quality standards, support, documentation, financial stability, compatibility, total cost, and trial.

## Answer

#### Approach for good programming practice
1. **Plan before coding:** understand the requirements and make a design (flowchart, pseudocode, state diagram) first.
2. **Modular, top-down design:** divide the program into small functions/modules, each doing one job (high cohesion, low coupling), with clear interfaces.
3. **Structured programming:** use sequence, selection and iteration; avoid goto and global variables; one entry and one exit per function.
4. **Meaningful names and consistent style:** descriptive names for variables and functions, consistent indentation and a coding standard.
5. **Comments and documentation:** a header per module (purpose, inputs, outputs, author, version) and comments explaining why, not what.
6. **Defensive programming:** check inputs and return values, handle errors and boundary cases, initialise variables, use watchdog timers in embedded code.
7. **Reuse and portability:** use tested library routines; keep hardware-dependent code separate; use constants instead of "magic numbers".
8. **Reviews and testing:** code inspection/walkthroughs, unit testing, and version control (Git).
9. **Keep it simple;** optimise only after measurement.

#### Criteria for selecting a software supplier (company)
1. **Reputation and track record:** years in business, references, number of similar installations, customer feedback.
2. **Quality of the product:** the company follows recognised process standards (ISO 9001, CMMI), has a testing and bug-tracking procedure, and published reliability or defect data.
3. **Support and maintenance:** helpdesk, updates and patches, response time, warranty, and long-term support.
4. **Documentation and training:** manuals, user training and source-code access/escrow.
5. **Financial stability** of the company, so that it will exist to support the product.
6. **Compatibility and security:** works with the existing hardware, OS and standards; security practices and licence terms.
7. **Cost:** total cost of ownership (licence, installation, training, upgrades), not just the price.
8. **Trial/evaluation:** demonstration or trial version and an acceptance test.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. In good programming practice, how should a program be divided?
   A. Into small modules, each doing one job, with high cohesion and low coupling
   B. Into one large function to avoid call overhead
   C. Into modules that share many global variables
   D. Into modules that each do several unrelated jobs
   Answer: A. Modular top-down design uses small single-purpose modules with clear interfaces. (Key point: Modular design)

2. Which is part of structured programming as described?
   A. Use goto freely for speed
   B. Use sequence, selection and iteration and avoid goto and globals
   C. Prefer global variables for data sharing
   D. Use several exit points per function
   Answer: B. Structured programming avoids goto and globals, with one entry and one exit per function. (Key point: Structured programming)

3. What should comments mainly explain?
   A. What every line does
   B. Only the author name
   C. Why the code does something
   D. Nothing; comments should be avoided
   Answer: C. Good comments explain why, not what, plus a module header. (Key point: Comments)

4. Which indicates a software company follows a quality process?
   A. Having the lowest price
   B. Having the largest advertisement
   C. Having the newest office
   D. ISO 9001 or CMMI with testing and bug-tracking procedures
   Answer: D. Recognised process standards and bug tracking show quality. (Key point: Supplier quality criteria)

5. When comparing software cost, what should be considered?
   A. Total cost of ownership including licence, installation, training and upgrades
   B. Only the licence price
   C. Only the installation cost
   D. Only the first-year discount
   Answer: A. Cost means total cost of ownership, not just price. (Key point: Total cost)

## Related in Instrumentation II

- [Selection criteria for ADC](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aadc-selection-criteria) — Instrumentation II, chapter 4, asked 3×
- [Software selection and purchase](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asoftware-selection-purchase) — Instrumentation II, chapter 9
- [Software maintenance and fixing common bugs](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-maintenance-bugs) — Instrumentation II, chapter 9

## Related in other subjects

- [Basic concepts of modular programming](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Amodular-programming) — Software Engineering, chapter 3
- [Ownership and structure for software company](https://www.bctengineer.com/question.md?key=semester_7%2Forganization_and_management%3Aceo-software-ownership) — Organization and Management, chapter 4
- [Proposal to start a software company](https://www.bctengineer.com/question.md?key=semester_5%2Fcommunication_english%3Aproposal-software-company-ministry) — Communication English, chapter 6
- [Features for selecting simulation software](https://www.bctengineer.com/question.md?key=semester_8%2Fsimulation_and_modeling%3Asimulation-software-features) — Simulation and Modeling, chapter 9
