Proucators
  • Trending
  • Programming
    • C#
    • Java
    • Python
    • JavaScript
  • Cyber Security
    • Security Awareness
    • Network Security
    • Cloud Security
    • Data Protection
  • Databases
    • SQL Server
    • MongoDB
    • PostgreSQL
    • MySQL
    • Cassandra
    • Redis
    • Google Cloud SQL
    • Azure Cosmos DB
    • Apache Kafka
  • AI
    • Generative AI
    • Machine Learning
    • Natural Language Processing
    • Computer Vision
    • Robotics
  • Apps
    • Social Media
    • Productivity
    • Entertainment
    • Games
    • Education
    • Finance
    • Health and Fitness
    • Travel
    • Food Delivery
    • Shopping
    • Utilities
    • Business
    • Creativity
  • Tech News
    • Computing
    • Internet
    • IT
    • Cloud Service
Community
Accessdrive

Transforming digital capabilities through project-based training and expert offshore development services for web, mobile, and desktop applications.

  • Trending
  • Programming
    • C#
    • Java
    • Python
    • JavaScript
  • Cyber Security
    • Security Awareness
    • Network Security
    • Cloud Security
    • Data Protection
  • Databases
    • SQL Server
    • MongoDB
    • PostgreSQL
    • MySQL
    • Cassandra
    • Redis
    • Google Cloud SQL
    • Azure Cosmos DB
    • Apache Kafka
  • AI
    • Generative AI
    • Machine Learning
    • Natural Language Processing
    • Computer Vision
    • Robotics
  • Apps
    • Social Media
    • Productivity
    • Entertainment
    • Games
    • Education
    • Finance
    • Health and Fitness
    • Travel
    • Food Delivery
    • Shopping
    • Utilities
    • Business
    • Creativity
  • Tech News
    • Computing
    • Internet
    • IT
    • Cloud Service
Community
Find With Us
Producators

20 Naming Conventions in C#

  • Producators
    Olumuyiwa Afolabi Category: C#
  • 7 months ago
  • 336
  • Back
20 Naming Conventions in C#

20 Naming Conventions in C#:

  1. Classes, Methods, Properties, Enums: Pascal Case (CustomerOrder, ProcessOrder)
  2. Local Variables, Method Parameters: camelCase (orderNumber, customerName)
  3. Private Fields: camelCase with Underscore (_customerName)
  4. Constants: ALL_CAPS (PI, MAX_LENGTH)
  5. Interfaces: Pascal Case with "I" Prefix (IOrderProcessor)
  6. Enums: Pascal Case for names and members (OrderStatus, Pending)
  7. Namespace Names: Pascal Case (CompanyName.ProjectName)
  8. File Names: Match class or interface names (CustomerOrder.cs)
  9. Event Names: Pascal Case with verbs (OrderProcessed)
  10. Boolean Variables: Prefixes like "is", "has", "can" (IsProcessed, HasShipped)
  11. Method Parameters: camelCase (orderNumber, orderDate)
  12. Static Fields: Pascal Case (ConnectionString)
  13. Readonly Fields: camelCase with underscore (_employeeId)
  14. Attributes: Pascal Case with "Attribute" suffix (AuthorAttribute)
  15. Async Methods: Pascal Case with "Async" suffix (ProcessOrderAsync)
  16. Collections and Arrays: Plural nouns (Products, CustomerAddresses)
  17. Delegate Names: Pascal Case with "Handler" suffix (OrderProcessedHandler)
  18. Extension Methods: Pascal Case (IsNullOrEmpty)
  19. Properties with Backing Fields: Pascal Case for properties, camelCase with underscore for backing fields (Name, _name)
  20. Constructor/Method Parameters: Descriptive camelCase (customerName, newName)

These 20 conventions ensure your C# code is clear, professional, and maintainable across different projects.

Producators

Similar Post

Top 20 NuGet Packages You Must Add to Your .NET Application
Top 20 NuGet Packages You Must Add to Your .NET Application
Read Article
How to Build a Sentiment Analysis Tool Using C#
How to Build a Sentiment Analysis Tool Using C#
Read Article
Creating a Chatbot with C# and Microsoft Bot Framework
Creating a Chatbot with C# and Microsoft Bot Framework
Read Article
Image Classification Using C# and TensorFlow: A Step-by-Step Guide
Image Classification Using C# and TensorFlow: A Step-by-Step Guide
Read Article
Working with Predictive Maintenance Using C# and Azure Machine Learning
Working with Predictive Maintenance Using C# and Azure Machine Learning
Read Article
Natural Language Processing (NLP) in C#: A Beginner's Guide
Natural Language Processing (NLP) in C#: A Beginner's Guide
Read Article
Deep Learning with C#: Convolutional Neural Networks (CNNs)
Deep Learning with C#: Convolutional Neural Networks (CNNs)
Read Article

©2025 Producators. All Rights Reserved

  • Contact Us
  • Terms of service
  • Privacy policy