naming-conventions

How do I choose a package name for a custom Perl module that does not collide with builtin or CPAN packages names?

元气小坏坏 提交于 2019-12-28 01:55:23
问题 I have read the perldoc on modules, but I don't see a recommendation on naming a package so it won't collide with builtin or CPAN module/package names. In the past, to develop a local Session.pm module, I have created a local directory using my company's name, such as: package Company::Session; ... and Session.pm would be found in directory Company/. But I'm just not a fan of this naming convention. I would rather name the package hierarchy closer to the functionality of the code. But that's

Why should java package name be lowercase?

半腔热情 提交于 2019-12-28 01:51:11
问题 Actually this is completely theoretic question. But it's interesting why java specification don't allow uppercase characters letters in package and cause write something like this: com.mycompany.projname.core.remotefilesystemsynchronization.* instead of com.myCompanyName.projName.core.remoteFileSystemSynchronization.* 回答1: Directly from Oracle Docs Package names are written in all lower case to avoid conflict with the names of classes or interfaces. 回答2: But it's interesting why java

Get a parameter's old name

跟風遠走 提交于 2019-12-27 04:48:27
问题 When I am tracing, I think it would be useful to do something like //In the main function { Log(myVariable); } Which sends the variable to a generic function like this //In the Logger file public static void TraceMessage<T>(T aVariable) { string oldName=GetOldName(aVariable); } I want "myVariable" to be assigned to oldName . What should GetOldName do? Something similar was asked here: get name of a variable or parameter But in all of those cases, "aVariable" is assigned to oldName . Update:

Does having multiple dots in a filename bad?

被刻印的时光 ゝ 提交于 2019-12-25 17:48:14
问题 Is there any organization or articles that says we can or should not have multiple dots in filename? I'm really confuse if I should use dot in PHP files, I might break some rules or standards. 回答1: A filename with multiple dots does not break any PHP naming conventions, because file names are not PHP variable names; they belong to the OS really and PHP only sees them as strings. EDIT I looked around and found cases for multiple dots: version numbers and dates. There has been some discussion

Should the version be appeared in the name of .jar files? [duplicate]

烂漫一生 提交于 2019-12-25 09:42:51
问题 This question already has answers here : Closed 8 years ago . Possible Duplicate: Jar file naming conventions Currently, I've decided to standardize the name of my .jar files. In many projects, the version of the .jar files appear in the name, e.g. richfaces-3.0.1.jar. Is it a good naming style or should I mention the version of the .jar file in its manifest? If it is better, should I use this style for my internal releaseses? 回答1: You should use Version numbers in your jars. Look at pages

Naming of HTML inputs

旧城冷巷雨未停 提交于 2019-12-25 04:34:20
问题 What is the recommended practice in Angular 2 for naming HTML controls: <input id="abc" name="abc" /> ? Id is necessary for things like <label for="abc">...</label> , while Angular binding needs name to be set. Any reason why id and name couldn't/shouldn't always be the same? How about when you have a component used more than once (e.g. in a list) or a parent and child component have the same id / name set. Angular might handle name correctly, but how do you prevent collisions with the id ?

Testing for floating-point value equality: Is there a standard name for the “precision” constant?

别说谁变了你拦得住时间么 提交于 2019-12-25 02:44:27
问题 I just read this nice answer given on how to compare floating-point values for equality. The following (slightly modified by me) is suggested instead of straight-forward comparison to 0: const double epsilon = 1e-5; double d = ...; if (Math.Abs(d) < epsilon) { // d is considered equal to 0. } My question is about the name of the variable epsilon 1) . Is "epsilon" the generally agreed-upon name for specifying the precision of floating-point numbers? (…which is the smallest discriminating

What naming convention for a C API

二次信任 提交于 2019-12-24 19:34:08
问题 We are working on a game engine written in C and currently we are using the following naming conventions. ABClass object; ABClassMethod(object, args) AB Being our prefix. Our API, even if working on objects, does not have inheritance, polymorphism or anything. All we have is data types and methods working on them. Our Constants are named alike: AB_ConstantName and Preprocessor macros are named like AB_API_BEGIN . We don't use function like macros. I was wondering how this was fitting as a C

Naming Preference for class fields in C#? [duplicate]

*爱你&永不变心* 提交于 2019-12-24 11:56:30
问题 This question already has answers here : Closed 10 years ago . I have seen several naming conventions used for fields in C#. They are: Underscore public class Foo { private string _name; public string Name { get { return _name; } set { _name = value; } } } This public class Foo { private string name; public string Name { get { return this.name; } set { this.name = value; } } } Member Prefix public class Foo { private string m_name; public string Name { get { return m_name; } set { m_name =

Laravel 5 Naming Conventions - Broker VS Manager

这一生的挚爱 提交于 2019-12-24 11:49:12
问题 Broker - is a word that sometimes comes into the naming convention, at least we have a PasswordBroker . But more often they are Managers like in - Support\Manager and Queue\Capsule\Manager ... What is the difference? When it should be Broker? PS I know that Laravel people for some reson don't like the word interface and say Contract instead. Is it the same here? 来源: https://stackoverflow.com/questions/51489562/laravel-5-naming-conventions-broker-vs-manager