Skip to main content

Posts

Showing posts from February, 2023

ASP.net Core Services Lifetime Differences Between Using AddTransient, AddScoped and AddSingleton Services

  ASP.net Core Services Lifetime Differences Between Using AddTransient, AddScoped and AddSingleton Services Overview In this blog post, I will be explaining to you the ASP.net core Service Lifetime and will be explaining to you what is the difference between them and which one can be a risk to a memory leak if used incorrectly. AddTransient, AddScoped, and AddSingleton are dependency injection services in ASP.NET Core. The differences between them are as follows below. AddTransient: A new instance of the service is created every time it is requested. AddScoped: A single instance of the service is created per request within the same scope. AddSingleton: A single instance of the service is created for the entire application lifetime. In general, it's recommended to use AddScoped for services that are stateful and AddTransient for services that are stateless or have a short lifetime. AddSingleton is usually used for services that are expensive to create or only need to be crea

Explaining Terraform Code as Infrastructure (CAI)

  Explaining Terraform Code as Infrastructure (CAI) What Is Terraform Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. It can manage popular service providers as well as custom in-house solutions. Terraform uses a declarative syntax to describe the desired state of infrastructure and automatically creates, updates, and deletes resources to reach the desired state. Why use Terraform Terraform is used because it offers several benefits over manual provisioning and other configuration management tools: Infrastructure as Code: Terraform allows you to describe your infrastructure using code, making it easier to version control, automate deployment, and share configurations. Cross-Provider Compatibility: Terraform can manage a diverse range of infrastructure resources across multiple cloud providers, on-premises data centres, and other infrastructure sources. Improved Collaboration and Workflow: Terraform enables teams to work together more ef

Best Practice for Code Reviewing JavaScript

   Best Practice for Code Reviewing JavaScript  Code review is an important step in the software development process that helps ensure code quality, maintainability, and consistency. Here are some best practices for code review of JavaScript code: 1. Know the code standards: Familiarize yourself with the project's coding standards, naming conventions, and best practices before starting a code review. This will help you identify areas where the code deviates from established standards and make suggestions for improvements. 2. Focus on maintainability: Code review should focus on code maintainability, readability, and scalability. Look for easy-to-understand and maintain code, and suggest changes where necessary. 3. Check for best practices and conventions: Ensure that the code follows best practices and conventions, such as naming conventions, coding style, and indentation. 4. Verify that the code is performant: Check that the code is performant and does not contain any performance

Best Practice for Code Reviewing C#

   Best Practice for Code Reviewing C# Code review is an important step in the software development process that helps ensure code quality, maintainability, and consistency. Here are some best practices for code review of C# code: 1. Know the code standards: Familiarize yourself with the project's coding standards, naming conventions, and best practices before starting a code review. This will help you identify areas where the code deviates from established standards and make suggestions for improvements. 2. Focus on maintainability: Code review should focus on code maintainability, readability, and scalability. Look for easy-to-understand and maintain code, and suggest changes where necessary. 3. Check for best practices and conventions: Ensure that the code follows best practices and conventions, such as naming conventions, coding style, and indentation. 4. Verify that the code is performant: Check that the code is performant and does not contain any performance bottlenecks. This

Best Practice for Code Reviewing TypeScript

Best Practice for Code Reviewing TypeScript Code review is an important part of software development that helps ensure code quality, maintainability, and consistency. Here are some best practices for code review of TypeScript code: 1. Know the code standards: Before starting a code review, familiarize yourself with the project's code standards and best practices. This will help you identify areas where the code deviates from established standards and make suggestions for improvements. 2. Focus on maintainability: Code review should focus on code maintainability, readability, and scalability. Look for code that is easy to understand and maintain, and suggest changes where necessary. 3. Check for best practices and conventions: Ensure that the code follows best practices and conventions, such as naming conventions, coding style, and indentation. 4. Check for type safety: TypeScript is a statically typed language, so it is important to check that the code is type-safe. Ensure that the

Coding Standards for C#

  Coding Standards in C# Overview The purpose of this document is to define a set of coding standards for C# projects. The purpose of these standards is to ensure consistency, readability, and maintainability of the codebase. The coding standards described in this document apply to all projects and codes developed by the organization. Naming Conventions Class names should be written in PascalCase. Method names should be written in PascalCase. Variable names should be written in camelCase. Constants should be written in ALL_CAPS and separated by underscores. Namespaces should be written in PascalCase. Formatting Use 4 spaces for indentation. Braces should be on a new line and aligned with the code block. Put a space before and after every operator. Put a blank line between methods to increase readability. Comments Write comments for all methods, classes, and complex blocks of code. Use XML documentation comments for public members. Use inline comments when necessary to explain complex