Coding Best Practices
Welcome to Performance & Best Practices section of C# Corner. In this section, you will find various Performance & Best Practices related source code samples, articles, tutorials, and tips.


  • David Mccarter

    Presenting Code Samples With A Dark Theme...Please Do Not

    For all of you who code using apps like Visual Studio or VS Code, please don’t present code in a meeting or conference session using a dark theme! I know I am going to get a lot of push back from t...
    David Mccarter Nov 12, 2018
  • Karthikeyan Sekar

    Handling Arithmetic Overflow

    When you are dealing with integer values which are in higher amounts, you might arrive at a situation where the program gives you the wrong output.
    Karthikeyan Sekar Oct 30, 2018
  • Jiteendra Sampathirao

    String and StringBuilder Classes

    Here I'm going to tell you about what is String and StringBuilder and what the differences between String and StringBuilder classes.
  • Matthew Cochran

    C# Heap(ing) Vs Stack(ing) in .NET: Part III

    Having a basic understanding of how memory management works will help explain the behavior of the variables we work with in every program we write. In this article we’ll cover an issue that arises...
    Matthew Cochran Oct 04, 2018
  • Sahil Sharma

    How To Write Effective Code

    How To Write Effective Code. The key to writing effective code is Delete Unnecessary Code, use clean code, learn coding from masters, Meaningful Code Commenting, Debug code and Trace, Unit Testing,...
    Sahil Sharma Sep 20, 2018
  • Sai Kumar Koona

    How To Improve Execution Performance Of An Application

    For every application could be small or medium or a big enterprises application the major non-functional requirement will be a good code performance. In some cases, companies will hire a special te...
    Sai Kumar Koona Aug 31, 2018
  • David Mccarter

    Performance Tip - Checking For Empty String

    In all my books and conference sessions I talk about the proper way to test if a string is valid. Microsoft .NET has been around for almost two decades.
    David Mccarter Aug 22, 2018
  • Ashish Vishwakarma

    Git For Absolute Beginners With Command Line Interface

    Explore Git via CLI like programmers, and learn black magic done by Git GUI clients.
    Ashish Vishwakarma Jun 19, 2018
  • Amit Kumar

    Best Practices Of Writing C# Code

    Anyone can write code with a few months of programming experience. But some developers know the coding standard and naming convention but not everyone follows the best practices
    Amit Kumar May 15, 2018
  • Ahmad Mozaffar

    Seven Tips To Increase Your Productivity

    Writing a robust code and finishing the project in a short time are the main characteristics of a professional job, so every developer should focus on his/her productivity to create efficient code ...
    Ahmad Mozaffar May 10, 2018
  • Dinesh  Kushwaha

    How To Implement TDD In C# Using NUnit Testing With NInject DI

    How to implement TDD (Test driven development) in c# (Csharp) using Nunit testing with NInject DI?
    Dinesh Kushwaha Apr 23, 2018
  • David Mccarter

    Defensive Programming - Let Type Checking Work For You

    Since I have been a speaker and a teacher, I have always stressed the importance of practicing proper object-oriented programming (OOP) techniques. If you don’t practice OOP, no matter what languag...
    David Mccarter Mar 19, 2018
  • David Mccarter

    Five Easy Rules For Your Source Control Repository

    I have been using source control programs for a very long time. I believe the first one was Visual Source Safe (don’t laugh, it was a painful experience). Early in my career and throughout I have l...
    David Mccarter Mar 04, 2018
  • Gaurav Gahlot

    When To Use "Var" As A Type

    It has been quite a long time since "var" was introduced, yet it is still a topic of debate among .net developers.
    Gaurav Gahlot Feb 17, 2018
  • Karishma Gajula

    SQL Coding Best Practices

    While executing your procedure, the system will first scan through all system procedures and then user defined procedures. This means that the procedure might take more time for execution thus decr...
    Karishma Gajula Feb 14, 2018
  • Sateesh Arveti

    Beautifying C# Code - Part II

    In this video, how we can beautify\reduce number of lines in your C# Code.
    Sateesh Arveti Jan 30, 2018
  • Sateesh Arveti

    Beautifying Your C# Code - Part I

    In this video, how we can beautify\reduce the number of lines in your C# code.
    Sateesh Arveti Jan 24, 2018
  • Ajay Mor

    Rules To Write Clean And Good Unit Tests

    Unit tests should be fast and run quickly. If they won't, then we won't want to run them frequently.
    Ajay Mor Jan 17, 2018
  • Sagar Shinde

    Code Metrics Cyclomatic Complexity

    Let's learn about Code Metrics Cyclomatic Complexity in this write-up.
    Sagar Shinde Dec 28, 2017
  • Bechir Bejaoui

    Some Real Differences Between Structures and Classes

    This article lists some differences between classes and structures.
    Bechir Bejaoui Aug 04, 2017
  • David Mccarter

    Confessions Of An Angry Programmer

    Recently, after doing the keynote session about code quality at a conference in Denver, I received a comment from one of the attendees. He said my session was “too much angry coder”. After receivin...
    David Mccarter Jul 23, 2017
  • Pankaj Sapkal

    Best Practices For MVC

    Add a class library project to the solution, named Store.Model. This library is where we ‘ll keep all of our domain objects. Entity Framework will count on them in order to build the database but w...
    Pankaj Sapkal Jul 14, 2017
  • David Mccarter

    My Workflow Before I Submit Code Changes

    In this article, you will learn about my Workflow before I submit code changes.
    David Mccarter Jun 26, 2017
  • Sundaram Subramanian

    Effective Application Development

    In this blog I would like to share some of my Application Development methodologies which give some more productivity in development.
  • Gul Md Ershad

    A Day With A Software Engineer Who Changes Text Labels Only

    This article will explain the way Software Engineers, who never focus on technical learning and remain busy in text label changing only.
    Gul Md Ershad Jun 16, 2017
  • View More