Programming Practice
Jump to navigation
Jump to search
A Programming Practice is a software development practice that encompasses various techniques, methodologies, and conventions used by programmers to write, structure, and maintain code in an efficient and effective manner.
- Context:
- It can (typically) involve guidelines and principles that shape how code is written, such as adhering to Coding Standards or using Design Patterns.
- It can (often) focus on reducing complexity and enhancing code readability through practices like Code Refactoring or Modular Design.
- It can range from being a Formalized Practice with strict rules to a more Flexible Practice tailored to specific project needs.
- It can influence the choice of Programming Paradigms such as Object-Oriented Programming, Functional Programming, or Procedural Programming.
- It can emphasize following security-focused programming practices to prevent vulnerabilities.
- ...
- Example(s):
- Python Type-Hinting Practices, which involve using type annotations to specify the expected data types in Python code.
- Test-Driven Development (TDD) Practices, where tests are written before the implementation to define desired behavior.
- Pair Programming Practices, where two developers work together on the same code, sharing roles of coding and reviewing.
- Version Control Practices (e.g., `git branching`), which define strategies for tracking changes and managing collaborative development.
- Agile Programming Practices, which involve iterative development and continuous feedback to adapt to changing requirements.
- Continuous Integration Practices, where code changes are integrated frequently, and automated tests are run to detect issues early.
- Code Review Practices, where peers review each other's code to ensure adherence to standards and identify potential bugs.
- Secure Programming Practices like Input Validation and Output Encoding to prevent vulnerabilities such as injection attacks.
- Static Analysis Practices, using tools to analyze code without executing it, identifying potential bugs and style issues.
- Runtime Type Checking Practices, using libraries like `typeguard` to enforce function parameter types during execution.
- Code Documentation Practices, where code is accompanied by comments and detailed docstrings to enhance readability.
- CI/CD Pipeline Practices, which automate testing and deployment of code changes.
- ...
- Counter-Example(s):
- Ad-Hoc Coding, which lacks a structured approach and may result in poor code quality and maintainability.
- No Documentation Practices, where code is written without accompanying comments or documentation, making it difficult to understand.
- Unplanned Development, where development lacks predefined goals or standards, often leading to chaotic and unorganized codebases.
- Anti-Patterns, which are practices that may seem beneficial but result in suboptimal outcomes (e.g., God Object, Spaghetti Code).
- Hard Coding, where values are directly embedded in code rather than using variables or configurations, reducing flexibility.
- See: Software Development Practices, Coding Standards Practices, Design Patterns Practices, Programming Paradigms, Software Engineering Practices
References
2022
- (Martin & Fowler, 2022) ⇒ Robert C. Martin, and Martin Fowler. (2022). "Clean Code: A Handbook of Agile Software Craftsmanship.” In: Addison-Wesley Professional.
- NOTE: It discusses various programming practices aimed at improving code quality and maintainability through principles of clean coding.
2019
- (Beck, 2019) ⇒ Kent Beck. (2019). "Test-Driven Development: By Example.” In: Addison-Wesley.
- NOTE: It introduces the concept of Test-Driven Development (TDD), a programming practice focused on defining tests before implementation.