Coder Social home page Coder Social logo

clean_code's Introduction

Clean Code Best Practices

Java:

  1. Keep functions concise, ideally not exceeding 60 lines.
  2. Employ interfaces for repositories.
  3. Prefer composition over inheritance when connecting classes for creating complex structures.
  4. Utilize records for defining data models.
  5. Consider using concurrency mechanisms over traditional multithreading approaches.
  6. Don't use comments in your code; prioritize writing self-explanatory code.
  7. Don't use a try-catch block; implement global exception handling.

Python:

  1. Embrace object-oriented programming (OOP) principles but prioritize "Functional Programming" paradigms.
  2. Keep functions concise, ideally limited to 60 lines.
  3. Enhance code readability by incorporating type hints.
  4. Utilize Pydantic for robust data validation.
  5. Consider leveraging asynchronous programming for improved performance.
  6. Don't use comments in your code; prioritize writing self-explanatory code.
  7. Don't use a try-catch block; implement global exception handling.

APIs Best Practices:

  1. Avoid designing APIs with bulk payloads; break down the API into smaller components.
  2. Implement API versions to manage changes and updates effectively.
  3. Utilize throttling mechanisms to control the number of requests the API can process.
  4. Implement rate-limiting strategies to regulate how frequently the API can be accessed.
  5. Implement caching (Save frequently used data to speed up responses).
  6. Implement connection pooling (Reuse existing database connections to save time and resources).

Principles:

  1. DRY (Don't repeat yourself)
  2. KISS (Keep it simple stupid)

clean_code's People

Contributors

suriya-mca avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.