What kind of prefix do you use for member variables?

No doubt, it’s essential for understanding code to give member variables a prefix so that they can easily be distinguished from “normal” variables. I dispute this claim. It’s not the least bit necessary if you have half-decent syntax highlighting. A good IDE can let you write your code in readable English, and can show you … Read more

Valid JavaBeans names for boolean getter methods

According to the JavaBeans specification section 8.3.2: Boolean properties In addition, for boolean properties, we allow a getter method to match the pattern: public boolean is<PropertyName>(); This “isPropertyName” method may be provided instead of a “get<PropertyName>” method, or it may be provided in addition to a “get<PropertyName>” method. In either case, if the is<PropertyName> method … Read more

What is the naming convention in Python for variables and functions?

See Python PEP 8: Function and Variable Names: Function names should be lowercase, with words separated by underscores as necessary to improve readability. Variable names follow the same convention as function names. mixedCase is allowed only in contexts where that’s already the prevailing style (e.g. threading.py), to retain backwards compatibility.

Change foreign key constraint naming convention

You can implement a custom sql generator class derived from SqlServerMigrationSqlGenerator from System.Data.Entity.SqlServer namespace: public class CustomSqlGenerator : SqlServerMigrationSqlGenerator { protected override void Generate(AddForeignKeyOperation addForeignKeyOperation) { addForeignKeyOperation.Name = getFkName(addForeignKeyOperation.PrincipalTable, addForeignKeyOperation.DependentTable, addForeignKeyOperation.DependentColumns.ToArray()); base.Generate(addForeignKeyOperation); } protected override void Generate(DropForeignKeyOperation dropForeignKeyOperation) { dropForeignKeyOperation.Name = getFkName(dropForeignKeyOperation.PrincipalTable, dropForeignKeyOperation.DependentTable, dropForeignKeyOperation.DependentColumns.ToArray()); base.Generate(dropForeignKeyOperation); } private static string getFkName(string primaryKeyTable, string foreignKeyTable, params string[] … Read more