Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 3.48 KB

File metadata and controls

43 lines (30 loc) · 3.48 KB

Filename: topic/general/Coding_Guidelines.md


Coding Guidelines

With a rich background in technology and digital marketing, I blend content creation with technical skill. My experience spans over two decades in software engineering, contributing to major tech firms and adhering to best practices. Earning over $528,742 annually, I guide individuals towards high-paying tech roles that don't require a bachelor's degree, always staying updated on development trends and techniques for efficient coding.


Coding Guidelines

1. Code Clarity

  • Rewriting Code Blocks: To ensure clarity, I rewrite entire code blocks rather than commenting out outdated versions. This approach prevents errors that can occur during the copy-paste process and keeps the codebase cleaner and more readable.
  • Why It’s Important: Commented-out code can clutter projects and may introduce mistakes when someone revisits it later. By rewriting code directly, I maintain only the latest and most relevant code, enhancing code readability.
  • Further Reading:

2. Performance and Reliability

  • Optimizing Performance: My focus is on coding for performance while ensuring reliability. I make careful choices to avoid over-optimization that could lead to reduced code dependability.
  • Examples of Performance Focus: Optimizing loops, using efficient data structures, and managing memory effectively. Reliability remains a priority by writing code that is easy to maintain and thoroughly tested.
  • Related Resource:

3. Error Handling

  • Detailed Error Logging: I focus on detailed error logging, which helps with both debugging and maintaining code quality over time. Each error should provide enough context to locate and resolve issues quickly.
  • Error Handling Mechanisms: Robust error-handling mechanisms help in maintaining the integrity of the application. I avoid silent errors, ensuring that each error either has a fallback or a clear notification to the user.
  • Documentation:

4. Storybook Usage

  • Component Story Format (CSF): For .stories files in Storybook, I use the Component Story Format (CSF) to create stories that are well-organized and compatible with Storybook’s latest updates.
  • Why Use CSF: CSF is the recommended way to define stories in Storybook, making it easier to create isolated examples of each component for testing purposes. It also helps in maintaining a consistent story format across projects.

5. Styled Components

  • TypeScript and Styled Components: When dealing with styled components in TypeScript, I always define component interfaces and include theme in default props.
  • Interfaces for Styling: Using interfaces for styled components ensures that all props are typed accurately. It also allows easier theme management by ensuring the theme is always accessible but not mandatory.
  • Further Reading: