naming-conventions

Should I use upper-case naming to declare java constant variables?

一曲冷凌霜 提交于 2021-02-20 06:00:08
问题 My question: Should names of constant Java variables (within methods) be upper-case? I've always been under the impression that a) if a variable is never going to change, it should be declared final (to show/enforce that it won't change) b) it should be named in upper-case However, I've noticed in eclipse, when changing a variable (within a method) to be final/constant, and subsequently refactoring/renaming it to something like below: final int NODE_COUNT = 3; I get the following warning:

EF 6, code first junction table name

我的未来我决定 提交于 2021-02-10 10:56:32
问题 I am experimenting with custom naming convenctions in EF 6. I have 2 tables and one junction table (WebUser, UserRequest, WebUserUserRequest). I have written function that should be able to rename tables: from WebUser to web_user private string GetTableName(Type type) { var result = Regex.Replace(type.Name, ".[A-Z]", m => m.Value[0] + "_" + m.Value[1]); return result.ToLower(); } It is applied this way: modelBuilder.Types() .Configure(c => c.ToTable(GetTableName(c.ClrType))); The function is

EF 6, code first junction table name

霸气de小男生 提交于 2021-02-10 10:52:07
问题 I am experimenting with custom naming convenctions in EF 6. I have 2 tables and one junction table (WebUser, UserRequest, WebUserUserRequest). I have written function that should be able to rename tables: from WebUser to web_user private string GetTableName(Type type) { var result = Regex.Replace(type.Name, ".[A-Z]", m => m.Value[0] + "_" + m.Value[1]); return result.ToLower(); } It is applied this way: modelBuilder.Types() .Configure(c => c.ToTable(GetTableName(c.ClrType))); The function is

Naming convention for methods returning RxJava's Completable

你离开我真会死。 提交于 2021-02-08 12:40:18
问题 I have and Android app with the view class ( Fragment , Activity ) observing its ViewModel . The ViewModel exposes methods such as getUserName which returns Observable<String> . Although maybe there is a possibility to find a better name (maybe observeUserName ), I'm happy with the current one - it is quite explanatory. However, here starts the hard part: ViewModel also can tell the view to perform some operation - for example close itself, pop backstack etc. For this case ViewModel defines

Is there a name for the date format “YYYY-MM-DD HH:MM:SS”?

爷,独闯天下 提交于 2021-02-07 05:28:05
问题 For talking over the phone or to my co-workers, is there a short-hand name for this date format already established? Names of other standard date formats would also be useful. 回答1: That is the ISO standard date and time. 回答2: ISO 8601 来源: https://stackoverflow.com/questions/8579293/is-there-a-name-for-the-date-format-yyyy-mm-dd-hhmmss

NumPy types with underscore: `int_`, `float_`, etc

自闭症网瘾萝莉.ら 提交于 2021-02-07 05:01:13
问题 What is the significance of the underscore suffixing in int_ , float_ , etc.? 回答1: From page 21 of Guide to Numpy by TE Oliphant: Names for the data types that would clash with standard Python object names are followed by a trailing underscore, ’ ’. These data types are so named because they use the same underlying precision as the corresponding Python data types. . . . The array types bool_ , int_ , complex_ , float_ , object_ , unicode_ , and str_ are enhanced-scalars. They are very similar

Javascript ENUM pattern naming convention

点点圈 提交于 2021-02-06 09:46:11
问题 I am working on a javascript project which requires use of javascript "Enums" meaning Objects like: var WinnerEnum = { Player1: 1, Player2: 2, Draw: 0 }; This is working great for me, however, I have no idea what is the proper way (according to convention) to name the Enum because as far as I know only class names start with a capital letter (indicating the ability to call a constructor on). JSHint also outputs the following warning: Missing 'new' prefix when invoking a constructor. If there

editorconfig - cannot get naming conventions to work

…衆ロ難τιáo~ 提交于 2021-02-06 09:19:47
问题 I created the following setup for C#. The idea is to have everything that's private named in camelCase and everything public and protected in UpperCase. Here's my .editorconfig setup (simplified): [*.{cs,cshtml}] # styles dotnet_naming_style.camel_case.capitalization = camel_case dotnet_naming_style.first_upper.capitalization = first_word_upper # symbols dotnet_naming_symbols.private_symbols.applicable_accessibilities = private dotnet_naming_symbols.public_symbols.applicable_accessibilities =

editorconfig - cannot get naming conventions to work

孤者浪人 提交于 2021-02-06 09:19:05
问题 I created the following setup for C#. The idea is to have everything that's private named in camelCase and everything public and protected in UpperCase. Here's my .editorconfig setup (simplified): [*.{cs,cshtml}] # styles dotnet_naming_style.camel_case.capitalization = camel_case dotnet_naming_style.first_upper.capitalization = first_word_upper # symbols dotnet_naming_symbols.private_symbols.applicable_accessibilities = private dotnet_naming_symbols.public_symbols.applicable_accessibilities =

Should I use the Java naming convention?

荒凉一梦 提交于 2021-02-05 05:56:05
问题 I'm assigned to a large project that is going to be done in Java and viewed by a few programmers on the team. I want the code to be readable and understandable, and so want the naming convention to suite everyone that reads it. I'm wondering if I have to use the Java naming convention in order for other people to view it and understand it naturally. I always use a type of my own naming convention that doesn't differ much from the Java naming convention but inherits from the C/C++ naming