Share via

Tips for becoming for efficient with c#

fluffydogbite 1 Reputation point
2021-07-27T00:43:08.6+00:00

I would like some tips for how to become more efficient in c#

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


1 answer

Sort by: Most helpful
  1. Daniel Zhang-MSFT 9,661 Reputation points
    2021-08-18T02:27:05.167+00:00

    Hi fluffydogbite-5476,
    Some tips to improve performance of C# code you can refer to:

    1. Choose your data type before using it.
    2. Use For loop instead of foreach.
    3. Choose when to use a class and when to use a structure.
    4. Always use Stringbuilder for String concatenation operations.
    5. Choose best way to assign class data member.
      And you can get some links by Google search for More Effective C#.
      Best Regards,
      Daniel Zhang

    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.