Skip to content

Latest commit

 

History

History
57 lines (45 loc) · 2.32 KB

File metadata and controls

57 lines (45 loc) · 2.32 KB

Best Coding Practices

Definition of Coding:

  1. The process of assigning a code to something for classification or identification.
  2. The process or activity of writing computer programs.

We aim to teach a coding mindset that complements technical expertise by providing clear guidelines tailored to complex real-world problems.

High-level Goals:

  1. Solve a specific problem.
  2. Ensure code is easy to read and understand.
  3. Make code maintainable and extendable.

Writing Code:

  • Always Solve a Specific Problem:

    • Avoid attempting to create overly generic solutions.
    • Articulate a clear description of the problem before coding.
    • Start documentation or README with a problem description.
  • Write Readable Code:

    • Use meaningful variable and function names.
    • Avoid hard coding and aim for flexibility.
    • Reference existing CSS files for styling that aligns with UI documentation guidelines.
    • Reuse classes to maintain consistency in styling across the application.
  • Coding Convention:

    • Variables and functions should reflect their purpose.
    • Hard coding should be minimized or avoided.
    • Consistent coding style enhances readability and understanding.

Comments and Documentation:

  • Comments explain non-obvious rationale.
  • Documentation should cover problem description, methodology, and references.
  • Provide clear instructions on navigating the code.

Maintainability and Extensibility:

  • Reduce code duplication and enhance code reuse.
  • Modularize code organization.
  • Limit variable scope and use configuration files for dynamic execution.
  • Utilize automated testing for quality assurance.

File Structure:

  • Organize files and data for repeatability and ease of revisiting.
  • Establish a clear, consistent, and descriptive file structure.
  • Consider collaborators and future reproducibility.

Naming Conventions:

  • Be descriptive and concise.
  • Avoid ambiguity, especially in versioning.
  • Utilize context and delimiters effectively.

Coding and Comment Style:

  • Use clear and consistent naming, structuring, and context.
  • Follow spacing conventions for readability.
  • Use comments sparingly, focusing on providing valuable context.

By adhering to these practices, we ensure code clarity, maintainability, and reproducibility, benefiting both current and future collaborators.