naming-conventions

Why do I see JavaScript variables prefixed with $?

▼魔方 西西 提交于 2019-12-03 11:59:52
This is sort of a meta-question. Many snippets of JavaScript I've seen here on SO are named with a dollar sign prefix (for example, $id on the second line of the snippet shown in this question). I'm not referring to jQuery or other libraries. I am well aware that this is valid, but it seems awkward to do when not necessary. Why do people name their variables like this? Is it just familiarity with a server-side language like PHP carrying over into their JavaScript code? I thought perhaps it was to identify a variable as being a jQuery object, for example when you save the result of a selection

Standard naming to the Spring beans

孤街醉人 提交于 2019-12-03 11:40:56
Somebody knows an standard naming to the Spring beans in a App Context? I used the camel case naming, but I'm not sure if exists an kind of standard, I searched in the net about that but I haven't found something. Bean Naming Conventions (Spring Manual section 3.3.1) The convention is to use the standard Java convention for instance field names when naming beans. That is, bean names start with a lowercase letter, and are camel-cased from then on. Examples of such names would be (without quotes) 'accountManager', 'accountService', 'userDao', 'loginController', and so forth. Naming beans

Defining properties and naming conventions in JavaScript

蹲街弑〆低调 提交于 2019-12-03 11:30:12
问题 I've been a good JavaScript programmer and adhered to the coding conventions enlisted by Douglas Crockford. However JavaScript has evolved since then and I believe the naming conventions are now outdated. For example Crockford said: Do not use _ (underbar) as the first character of a name. It is sometimes used to indicate privacy, but it does not actually provide privacy. If privacy is important, use the forms that provide private members. Avoid conventions that demonstrate a lack of

Naming conventions for template types?

喜欢而已 提交于 2019-12-03 10:52:02
问题 Traditionally, the names of template types are just a single upper-case letter: template<class A, class B, class C> class Foo {}; But I hesitate to do this because it's non-descriptive and hard therefore to read. So, wouldn't something like this be better: template<class AtomT, class BioT, class ChemT> class Foo {}; I also tend to think the following would not be a bad idea: template<class ATOM, class BIO, class CHEM> class Foo {}; It makes them stand out (and also, it's upper-case letters

Naming convention for non-virtual and abstract methods

时光毁灭记忆、已成空白 提交于 2019-12-03 10:43:14
问题 I frequently find myself creating classes which use this form (A): abstract class Animal { public void Walk() { // TODO: do something before walking // custom logic implemented by each subclass WalkInternal(); // TODO: do something after walking } protected abstract void WalkInternal(); } class Dog : Animal { protected override void WalkInternal() { // TODO: walk with 4 legs } } class Bird : Animal { protected override void WalkInternal() { // TODO: walk with 2 legs } } Rather than this form

Naming Conventions for .NET / C# / WPF Projects

隐身守侯 提交于 2019-12-03 10:34:23
问题 What is a widely accepted naming convention for .NET/C#/WPF projects? 回答1: Microsoft has an extensive MSDN article on naming conventions here. 回答2: Here are some useful links on this subject .Net Naming Conventions and Programming Standards - Best Practices Naming Conventions for .NET / C# Projects Naming Conventions & Coding Standards for .NET Goog Luck! 回答3: You can see Philips Healthcare - C# Coding Standard for C# It look very good. And of course Design Guidelines for Developing Class

Underscores or camelCase in PostgreSQL identifiers, when the programming language uses camelCase?

会有一股神秘感。 提交于 2019-12-03 10:29:22
问题 This has been bothering me for a while, and I can't arrive at a solution that feels right ... Given an OO language in which the usual naming convention for object properties is camelCased, and an example object like this: { id: 667, firstName: "Vladimir", lastName: "Horowitz", canPlayPiano: true } How should I model this structure in a PostgreSQL table? There are three main options: unquoted camelCase column names quoted camelCase column names unquoted (lowercase) names with underscores They

JavaScript naming convention for promises? [closed]

喜夏-厌秋 提交于 2019-12-03 10:25:02
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . I feel it would be useful to have a naming convention for JavaScript variables which hold a promise . I don't generally like or

Naming convention for Visual Studio solutions and projects

删除回忆录丶 提交于 2019-12-03 10:23:27
We were thinking about organizing our BIG project this way: \trunk [CompanyName] [Product1] [Project1] CompanyName.Product1.Project1.csproj [Project2] CompanyName.Product1.Project2.csproj CompanyName.Product1.sln [Product2] We were trying to follow Microsoft's recommendation that namespace names follow folder structure, but are there any drawbacks for making it this way? What is the naming convention for solutions and projects that you apply? That looks pretty good if you ask me. Especially naming your projects by their full name including full name space part. I've found this helpful when

Microsoft VB.NET naming convention

穿精又带淫゛_ 提交于 2019-12-03 10:20:06
问题 Is there any standard naming convention for VB.NET ? Based your programming experiences, would like to share your naming convention for VB.NET ? Are there any guides for this kind of good practice besides patterns & practices Guidance Explorer and Guidance Share ? Thanks. Happy Weekend. 回答1: As Mehrdad said, VB.NET follows the General .NET naming conventions. More specificly: Types, events, read-only static fields, methods, namespaces, properties: PascalCase Parameters: camelCase Acronyms of