Question: Describe four coding principles
Answer : The principles that guide the coding task and are closely aligned with
programming style, programming languages, and programming methods
1) Preparation principles: Before you write one line of code, be sure you
Understand of the problem you’re trying to solve.
Understand basic design principles and concepts.
Pick a programming language that meets the needs of the software to be
built and the environment in which it will operate.
Select a programming environment that provides tools that will make your
work easier
2) Programming principles: As you begin writing code, be sure you
Constrain your algorithms by following structured programming practice.
Consider the use of pair programming.
Select data structures that will meet the needs of the design.
Keep conditional logic as simple as possible.
Create nested loops in a way that makes them easily testable.
Select meaningful variable names and follow other local coding standards.
Create a visual layout (e.g., indentation and blank lines) that aids
understanding.
3) Validation Principles: After you’ve completed your first coding pass, be sure you
Conduct a code walkthrough when appropriate.
Perform unit tests and correct errors you’ve uncovered.
Refactor the code
4) Evolution & Maintenance Principles : After validation and deployment, your
responsibility doesn’t end
Monitor code performance and behaviour in production.
Maintain the codebase — fix bugs, update dependencies, and adapt to changing
requirements
Document changes clearly for future maintainers
Continuously improve the code — through refactoring, optimization, and
technical debt reduction
Incorporate user feedback and analytics into future iterations.