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.

Articles

  • Generics in C# 2.0

    In this article, I specifically talk about Generics and how they improve upon arraylists and how they solve the issues posed by ArrayLists.
  • All About SQL Injection Attack and Prevention

    Considering security as the most important aspect of an application and as the First step in SOUND Programming Methodology, we will be covering SQL Injection Attack and Prevention.
  • Some Real Differences Between Structures and Classes

    This article lists some differences between classes and structures.
  • An Effective Coding And Code Review Technique

    Coding and Code review are the most basic building blocks of any software product. Any lapse may severely affect the schedule, quality, and of course the cost. Not only in the review but a few issues can also be found at a later stage as well. That may lead to rework.
  • C# Heap(ing) Vs Stack(ing) In .NET - Part Three

    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 from having reference variables in the heap and how to fix it using ICloneable.
  • Best Practices No 5: Detecting .NET application memory leaks

    In this article we are going to detect the .NET application memory leaks.
  • Ineffective Coding Habits - What To Avoid

    In this article, I'll be talking about some habits of programmers which are not so effective. We'll be looking into what to avoid and how to code effectively.
  • 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 this statement but let me explain why (please keep reading).
  • 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.
  • 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, effective Code Style.
  • 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 team or outsource to improve their existing application's performance.
  • Git For Absolute Beginners With Command Line Interface

    Explore Git via CLI like programmers, and learn black magic done by Git GUI clients.
  • 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
  • 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 language you are using, I guarantee you will end up with a “house of cards” and they all eventually fall.
  • 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 learned many good practices that I still use to this day. I will share them with you now.
  • 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.
  • 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 decreasing system performance.
  • Code Metrics Cyclomatic Complexity

    Let's learn about Code Metrics Cyclomatic Complexity in this write-up.
  • 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 receiving many great comments about the session, this one took me by surprise. I thought about it for awhile and commented back, via Twitter…
  • 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 we are not going to configure Code First using DataAnnotations attributes on this project. Instead, we are going to put all the Code First configuration in specific Configuration classes using the Fluent API. Add a folder named Models.
  • View More