Entity Framework Code First naming conventions – back to plural table names?

The RTM version of Code First will fully support a cool feature called Pluggable Conventions where you can add or replace the default conventions such as the one you mentioned. Fortunately, what you are looking for is already included in CTP5. You can switch off the pluralizing table names convention with removing PluralizingTableNameConvention convention. This … Read more

How do I remove underscore of foreign key fields in code first by convention

I finally found an answer for this, by writing a custom convention. This convention works in EF 6.0 RC1 (code from last week), so I think it’s likely to continue to work after EF 6.0 is released. With this approach, the standard EF conventions identify the independent associations (IAs), and then create the EdmProperty for … Read more

C# Field Naming Guidelines?

_camelCase for fields is common from what I’ve seen (it’s what we use at our place and Microsoft prefer for the .NET Runtime). My personal justification for using this standard is that is is easier to type _ to identify a private field than this. For example: void Foo(String a, String b) { _a = … Read more

What is a good naming convention for vars, methods, etc in C++? [closed]

Do whatever you want as long as its minimal, consistent, and doesn’t break any rules. Personally, I find the Boost style easiest; it matches the standard library (giving a uniform look to code) and is simple. I personally tack on m and p prefixes to members and parameters, respectively, giving: #ifndef NAMESPACE_NAMES_THEN_PRIMARY_CLASS_OR_FUNCTION_THEN_HPP #define NAMESPACE_NAMES_THEN_PRIMARY_CLASS_OR_FUNCTION_THEN_HPP #include … Read more

Is there a convention to name collection in MongoDB?

The general conventions are: Lowercase names: this avoids case sensitivity issues, as MongoDB collection names are case sensitive. Plural: more obvious to label a collection of something as the plural, e.g. “files” rather than “file” No word separators: Avoids issues where different people (incorrectly) separate words (username <-> user_name, first_name <-> firstname). This one is … Read more

Naming Conventions For Partial Class Files

I use . separation – for example EmployeeController.SomeSpecialBehaviour.cs. I also link it into the project tree via “dependentUpon” or whatever it is in the csproj, so that it nests under the file (in solution explorer) neatly. You have to do that by hand (edit the csproj) or with an addin, though; for example: <Compile Include=”Subfolder/Program.cs” … Read more

Where did the name `atoi` come from?

It means Ascii to Integer. Likewise, you can have atol for Ascii to Long, atof for Ascii to Float, etc. A Google search for ‘atoi “ascii to integer”‘ confirms this on several pages. I’m having trouble finding any official source on it… but in this listing of man pages from Third Edition Unix (1973) collected … Read more

What are the most common naming conventions in C?

The most important thing here is consistency. That said, I follow the GTK+ coding convention, which can be summarized as follows: All macros and constants in caps: MAX_BUFFER_SIZE, TRACKING_ID_PREFIX. Struct names and typedef’s in camelcase: GtkWidget, TrackingOrder. Functions that operate on structs: classic C style: gtk_widget_show(), tracking_order_process(). Pointers: nothing fancy here: GtkWidget *foo, TrackingOrder *bar. … Read more