Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7716017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T02:31:54+00:00 2026-06-01T02:31:54+00:00

The naming convention for constants in C# is Pascal casing: private const int TheAnswer

  • 0

The naming convention for constants in C# is Pascal casing:

private const int TheAnswer = 42;

But sometimes we need to represent already-existing constants from the Windows API.

For example, I don’t know how to name this:

/// <summary>
/// With this style turned on for your form, 
/// Windows double-buffers the form and all its child controls.
/// </summary>
public const int WS_EX_COMPOSITED = 0x02000000;

What should I name it?

Keeping it as WS_EX_COMPOSITED allows me to quickly associate it with the WinAPI, but it’s wrong.

Some options:

  • WsExComposited — Too hungarian
  • Composited — Too short
  • WsEx enum with Composited in it — Still hungarian
  • ExtendedWindowsStyles.Composited — Constant in a class? Enum?

It should be noted that the objectives for a good naming are:

  • It must be readable.
  • It must not trigger FxCop and StyleCop, even if that means hiding it from them.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T02:31:55+00:00Added an answer on June 1, 2026 at 2:31 am

    WS_EX_COMPOSITED is perfectly fine for part that directly interfaces with Win API (or any other documented API for that matter). The portion that you want to expose should follow standard conventions – have separate public facade to call native functions with good method names (you’ll eventually forget what you’ve researched about particular combinations of flags, but good wrapper method name will at least let you use it).

    The side benefit of keeping the name as close as possible to native API is that you can search for constant directly in the MSDN/other documentation and find answer immediately. It will be much harder if you rename it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Which naming convention do you use for local constants in C# and why? const
In my project currently we are using All caps as naming convention for constants.
Possible Duplicate: C# naming convention for constants? I'm refactoring a library in C# and
Sometimes I see Name+Name.m naming convention for a file in an XCode project. What
Microsoft naming conventions for .Net put constants in Pascal Case. In fact, it explicitly
Is there any way to create a naming convention for my primary key constraints
You can have different naming convention for class members, static objects, global objects, and
what is the naming convention for message bundle property files when using variants? for
We are deciding the naming convention for tables, columns, procedures, etc. at our development
What is the preferred naming convention for Django model classes?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.